public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR tree-opt/17529, ICE due to *&a not being folded to a[0]
@ 2004-10-24  3:07 Andrew Pinski
  2004-10-27 17:10 ` Jeffrey A Law
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2004-10-24  3:07 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 688 bytes --]

I think the subject says what causes the problem and the reason why
we don't fold *&a into a[0] is because fold does not handle it
but fold_stmt does.  So what I did was to patch remove_useless_stmts_1
to do the folding for us (this is already done for the second testcase
in the PR, for MODIFY_EXPR).  I also removed the case for SWITCH_EXPR
in remove_useless_stmts_1 because it was not needed at all and just
slowed us down.

OK? Bootstrapped and tested on powerpc-darwin.



ChangeLog:

	* tree-cfg.c (remove_useless_stmts_1) <case SWITCH_EXPR>:
	Don't fold statement.
	<case ASM_EXPR>: Fold the statement.

testsuite/ChangeLog:
	* gcc.c-torture/compile/pr17529.c: Remove the xfail.



[-- Attachment #2: temp.diff.txt --]
[-- Type: text/plain, Size: 1000 bytes --]

Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.89
diff -u -p -r2.89 tree-cfg.c
--- tree-cfg.c	23 Oct 2004 19:17:08 -0000	2.89
+++ tree-cfg.c	24 Oct 2004 01:04:09 -0000
@@ -1600,7 +1600,7 @@ remove_useless_stmts_1 (tree *tp, struct
 	  }
       }
       break;
-    case SWITCH_EXPR:
+    case ASM_EXPR:
       fold_stmt (tp);
       data->last_goto = NULL;
       break;
Index: testsuite/gcc.c-torture/compile/pr17529.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.c-torture/compile/pr17529.c,v
retrieving revision 1.2
diff -u -p -r1.2 pr17529.c
--- testsuite/gcc.c-torture/compile/pr17529.c	18 Oct 2004 22:03:15 -0000	1.2
+++ testsuite/gcc.c-torture/compile/pr17529.c	24 Oct 2004 01:04:09 -0000
@@ -1,4 +1,3 @@
-/* { dg-xfail-if "PR middle-end/17529" { "*-*-*" } { "*" } { "" } } */
 
 static inline void 
 bar (const int * const x) 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-28  2:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-24  3:07 [PATCH] Fix PR tree-opt/17529, ICE due to *&a not being folded to a[0] Andrew Pinski
2004-10-27 17:10 ` Jeffrey A Law
2004-10-27 17:30   ` Andrew Pinski
2004-10-28  3:19     ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).