[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread mrs at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

m...@gcc.gnu.org  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||4.6.1
 Resolution||FIXED

--- Comment #9 from mrs at gcc dot gnu.org  2011-04-09 
00:01:39 UTC ---
Fixed.


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread mrs at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #8 from mrs at gcc dot gnu.org  2011-04-08 
23:56:48 UTC ---
Author: mrs
Date: Fri Apr  8 23:56:45 2011
New Revision: 172219

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172219
Log:
PR testsuite/48506
* gcc.dg/tree-ssa/ssa-ccp-17.c: Robustify against ports that
default to fno-common.

Modified:
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread mrs at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #7 from mrs at gcc dot gnu.org  2011-04-08 
23:54:02 UTC ---
Author: mrs
Date: Fri Apr  8 23:53:59 2011
New Revision: 172218

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172218
Log:
PR testsuite/48506
* gcc.dg/tree-ssa/ssa-ccp-17.c: Robustify against ports that
default to fno-common.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-17.c


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread mikestump at comcast dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #6 from Mike Stump  2011-04-08 
22:41:16 UTC ---
How about something like the below.  I't leaves the scan alone (nice property),
ensures there is a memory access and will work on common and no-common ports
equally well.

Ok?

Index: gcc.dg/tree-ssa/ssa-ccp-17.c
===
--- gcc.dg/tree-ssa/ssa-ccp-17.c(revision 1272)
+++ gcc.dg/tree-ssa/ssa-ccp-17.c(working copy)
@@ -18,7 +18,7 @@
   return ((struct Foo *)p)->i;
 }

-const struct Foo g;
+extern const struct Foo g;

 int foobar(void)
 {


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread mikestump at comcast dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #5 from Mike Stump  2011-04-08 
22:35:19 UTC ---
Ah, insight, this is a no-common port I'm working on, so indeed an initializer
would fix it for me.


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-08 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

Richard Guenther  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.04.08 08:44:22
 Ever Confirmed|0   |1

--- Comment #4 from Richard Guenther  2011-04-08 
08:44:22 UTC ---
Hmm, it _should_ be able to fold g.i to 0.  It doesn't because
targetm.binds_local_p () returns false on g because its DECL_COMMON.
Maybe not so on darwin?

6779  /* Uninitialized COMMON variable may be unified with symbols
6780 resolved from other modules.  */
6781  else if (DECL_COMMON (exp)
6782   && !resolved_locally
6783   && (DECL_INITIAL (exp) == NULL
6784   || DECL_INITIAL (exp) == error_mark_node))
6785local_p = false;

thus -fno-common makes the testcase fail for me.

I'd say change it to have an explicit initializer,

const struct Foo g = { 0 };

and scan for "return 0;" instead.


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-07 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #3 from Andrew Pinski  2011-04-07 
21:53:33 UTC ---
(In reply to comment #2)
> I'd do the checkin, if you let me know if you prefer the one case removed, or
> volatile added.

Hmm, this testcase works for me in 4.6.x and on the trunk.


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-07 Thread mrs at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

--- Comment #2 from mrs at gcc dot gnu.org  2011-04-07 
21:51:06 UTC ---
I'd do the checkin, if you let me know if you prefer the one case removed, or
volatile added.


[Bug testsuite/48506] ssa-ccp-17.c = g.i fails

2011-04-07 Thread mrs at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48506

m...@gcc.gnu.org  changed:

   What|Removed |Added

 CC||rguenther at suse dot de
  Known to fail||4.6.0

--- Comment #1 from mrs at gcc dot gnu.org  2011-04-07 
21:50:13 UTC ---
This should be fixed in 4.6.x.