* gimple.c (recalculate_side_effects) <tcc_constant>: New case.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 7 Dec 2008 23:27:14 +0000 (23:27 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 7 Dec 2008 23:27:14 +0000 (23:27 +0000)
From-SVN: r142541

gcc/ChangeLog
gcc/gimple.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/string_comparison.adb [new file with mode: 0644]

index 19d56b0bfc78a24fc5f65ae97cdf3ec3a5ec1b08..b530d25614a20c85b91f76465eefdf5dde5e03de 100644 (file)
@@ -1,3 +1,7 @@
+2008-12-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gimple.c (recalculate_side_effects) <tcc_constant>: New case.
+
 2008-12-07  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/38405
index c0f8f1d53003665beddf0f07469382bfe4ba132f..90de9b3ebc56e9160c781782c88366026148e1df 100644 (file)
@@ -3108,8 +3108,11 @@ recalculate_side_effects (tree t)
        }
       break;
 
+    case tcc_constant:
+      /* No side-effects.  */
+      return;
+
     default:
-      /* Can never be used with non-expressions.  */
       gcc_unreachable ();
    }
 }
index 098e6627dd0fa6516257c1a4870409f64a186199..696d82a1a53257f0ccf027a838d1f483bae0b8ac 100644 (file)
@@ -1,3 +1,7 @@
+2008-12-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/string_comparison.adb: New test.
+
 2008-12-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR tree-optimization/38405
diff --git a/gcc/testsuite/gnat.dg/string_comparison.adb b/gcc/testsuite/gnat.dg/string_comparison.adb
new file mode 100644 (file)
index 0000000..22e6c9e
--- /dev/null
@@ -0,0 +1,10 @@
+-- { dg-do compile }
+
+with Ada.Text_IO; use Ada.Text_IO;
+
+procedure String_Comparison is
+   package Bool_IO is new Enumeration_IO (Boolean);
+   use Bool_IO;
+begin
+   Put (Boolean'Image (True) = "True");
+end;