]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/37617 (ICE on valid code)
authorRichard Guenther <rguenther@suse.de>
Wed, 1 Oct 2008 16:23:23 +0000 (16:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 1 Oct 2008 16:23:23 +0000 (16:23 +0000)
2008-10-01  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/37617
* tree-ssa-pre.c (create_expression_by_pieces): During FRE
do not add to the NEW_SETS.

* gcc.c-torture/compile/pr37617.c: New testcase.

From-SVN: r140816

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr37617.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index d20066c4cbb4cf66dce40b44566ab20382fb37be..d053f30da87a34b9aa13d75d024a727d7cf8976a 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-01  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/37617
+       * tree-ssa-pre.c (create_expression_by_pieces): During FRE
+       do not add to the NEW_SETS.
+
 2008-10-01  Richard Guenther  <rguenther@suse.de>
 
         PR middle-end/37285
index 16a233a5c7f69fdfea2cc3d74e939c6fb3a9f943..d2f70a06b6576a32b4537ac1ab3a20d225bb7f0f 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-01  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/37617
+       * gcc.c-torture/compile/pr37617.c: New testcase.
+
 2008-10-01  Richard Guenther  <rguenther@suse.de>
 
         PR middle-end/37285
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37617.c b/gcc/testsuite/gcc.c-torture/compile/pr37617.c
new file mode 100644 (file)
index 0000000..901b8ca
--- /dev/null
@@ -0,0 +1,19 @@
+typedef union
+{
+  char *string;
+  double dval;
+  float fval;
+} yystype;
+char *f(void)
+{
+  yystype tok;
+  tok.dval = 0;
+  return (tok.string);
+}
+char *f1(void)
+{
+  yystype tok;
+  tok.fval = 0;
+  return (tok.string);
+}
+
index cd344af2d101dae812998dc6a67c4907de6555d2..84c884b060cf05780f184fd1a2157008a4feb8ae 100644 (file)
@@ -2885,7 +2885,8 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
              VN_INFO (forcedname)->value_id = get_next_value_id ();
              nameexpr = get_or_alloc_expr_for_name (forcedname);
              add_to_value (VN_INFO (forcedname)->value_id, nameexpr);
-             bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
+             if (!in_fre)
+               bitmap_value_replace_in_set (NEW_SETS (block), nameexpr);
              bitmap_value_replace_in_set (AVAIL_OUT (block), nameexpr);
            }
          mark_symbols_for_renaming (stmt);