* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
@ 2008-07-24 9:05 ` doko at ubuntu dot com
2008-07-24 9:06 ` doko at ubuntu dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from doko at ubuntu dot com 2008-07-24 09:05 -------
Created an attachment (id=15948)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15948&action=view)
preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
2008-07-24 9:05 ` [Bug tree-optimization/36917] " doko at ubuntu dot com
@ 2008-07-24 9:06 ` doko at ubuntu dot com
2008-07-24 9:07 ` doko at ubuntu dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from doko at ubuntu dot com 2008-07-24 09:06 -------
Created an attachment (id=15949)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15949&action=view)
tree dump (r136501 reverted)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
2008-07-24 9:05 ` [Bug tree-optimization/36917] " doko at ubuntu dot com
2008-07-24 9:06 ` doko at ubuntu dot com
@ 2008-07-24 9:07 ` doko at ubuntu dot com
2008-07-24 9:07 ` doko at ubuntu dot com
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from doko at ubuntu dot com 2008-07-24 09:07 -------
Created an attachment (id=15951)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15951&action=view)
diff of tree dump
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (2 preceding siblings ...)
2008-07-24 9:07 ` doko at ubuntu dot com
@ 2008-07-24 9:07 ` doko at ubuntu dot com
2008-07-24 9:16 ` doko at ubuntu dot com
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from doko at ubuntu dot com 2008-07-24 09:06 -------
Created an attachment (id=15950)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15950&action=view)
tree dump (r136501)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (3 preceding siblings ...)
2008-07-24 9:07 ` doko at ubuntu dot com
@ 2008-07-24 9:16 ` doko at ubuntu dot com
2008-07-24 9:28 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from doko at ubuntu dot com 2008-07-24 09:15 -------
-O3 and -fwrapv, r136501 not reverted works
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (4 preceding siblings ...)
2008-07-24 9:16 ` doko at ubuntu dot com
@ 2008-07-24 9:28 ` pinskia at gcc dot gnu dot org
2008-07-24 9:32 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-07-24 9:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-07-24 09:27 -------
if -fwrapv works then is really a bug? Yes overflow is defined in java but c++
is not java.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (5 preceding siblings ...)
2008-07-24 9:28 ` pinskia at gcc dot gnu dot org
@ 2008-07-24 9:32 ` rguenth at gcc dot gnu dot org
2008-07-24 9:32 ` doko at ubuntu dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-24 9:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from rguenth at gcc dot gnu dot org 2008-07-24 09:31 -------
Looking at the source I don't see any integer overflows - the fact that
-fno-ivopts makes it work and the effect is on a variable introduced by
ivopts hints at a GCC bug more than a application bug.
So - now I cannot put the state back to UNCONFIRMED. :P
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-07-24 09:31:51
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (6 preceding siblings ...)
2008-07-24 9:32 ` rguenth at gcc dot gnu dot org
@ 2008-07-24 9:32 ` doko at ubuntu dot com
2008-07-24 9:52 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-24 9:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from doko at ubuntu dot com 2008-07-24 09:31 -------
Created an attachment (id=15952)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15952&action=view)
preprocessed source (no pch used)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (7 preceding siblings ...)
2008-07-24 9:32 ` doko at ubuntu dot com
@ 2008-07-24 9:52 ` rguenth at gcc dot gnu dot org
2008-07-25 12:14 ` rguenth at gcc dot gnu dot org
2008-07-25 13:55 ` doko at ubuntu dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-24 9:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2008-07-24 09:52 -------
The difference comes from the second VRP pass which concludes that c_76 is
[1, +INF] from which it changes
# c_173 = PHI <0(7), c_76(12)>
to
# c_173 = PHI <0(7), 1(12)>
which it concludes from
c_76 = (Cell) D.156138_4;
where Cell is
enum Cell {
Cell_0
};
so the only valid values for c_76 are 0 and 1. The problem is probably here
(c is of type Cell):
D.156112_62 = c_173 * 4;
(D.156112 is unsigned int), where we obviously miss a cast in the IL.
This is from inlining ciTypeFlow::StateVector::type_at which looks like
ciType* ciTypeFlow::StateVector::type_at(ciTypeFlow::Cell) const (this, c)
{
struct ciType * D.144073;
struct ciType * * D.144074;
unsigned int D.144075;
struct ciType * * D.144076;
D.144074 = this->_types;
D.144075 = c * 4;
D.144076 = D.144074 + D.144075;
D.144073 = *D.144076;
return D.144073;
}
gimplified from
return <retval> = *((struct ciType * *) ((const struct StateVector *)
this)->_types + (unsigned int) ((unsigned int) c * 4));
which hints at that c probably has the same precision and signedness as
unsigned int.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (8 preceding siblings ...)
2008-07-24 9:52 ` rguenth at gcc dot gnu dot org
@ 2008-07-25 12:14 ` rguenth at gcc dot gnu dot org
2008-07-25 13:55 ` doko at ubuntu dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-07-25 12:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from rguenth at gcc dot gnu dot org 2008-07-25 12:14 -------
I belive this is just INVALID. The code seems to do lots of things with
this enum Cell, but the C++ compiler is allowed to just allocate 1 bit of
storage for it.
Maybe changing the Cell declaration to
enum Cell { Cell_0, Cell_max = UINT_MAX }
fixes the issue.
See 7.2/6 for the standard wording.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/36917] [4.3 regression] miscompilation with -O2 and r136501
2008-07-24 9:05 [Bug tree-optimization/36917] New: [4.3 regression] miscompilation with -O2 and r136501 doko at ubuntu dot com
` (9 preceding siblings ...)
2008-07-25 12:14 ` rguenth at gcc dot gnu dot org
@ 2008-07-25 13:55 ` doko at ubuntu dot com
10 siblings, 0 replies; 12+ messages in thread
From: doko at ubuntu dot com @ 2008-07-25 13:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from doko at ubuntu dot com 2008-07-25 13:54 -------
the suggested change fixes the OpenJDK build.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36917
^ permalink raw reply [flat|nested] 12+ messages in thread