public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30088]  New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
@ 2006-12-06 16:59 heikki dot tauriainen at tkk dot fi
  2006-12-06 17:01 ` [Bug c++/30088] " heikki dot tauriainen at tkk dot fi
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: heikki dot tauriainen at tkk dot fi @ 2006-12-06 16:59 UTC (permalink / raw)
  To: gcc-bugs

The following C++ program (preprocessed source attached) produces unexpected
results when compiled with -O1 -fstrict-aliasing (as opposed to -O1 only) or
with any higher level of optimization (-O2 or -O3).  No compilation warnings
are emitted in any of the cases.


#include <cassert>
#include <string>

struct A
{
  A() : _x(0.0), _y(0.0) { }
  float& f(const int& i) { return (i == 0 ? _x : _y); }
  float _x, _y;
};

struct B
{
  B(const char* s) : _s(s) { }
  std::string g() { return std::string(_s); }
  const char* _s;
};

A h(const char* s)
{
  if (s == 0)
    return A();
  A a;
  B b(s);
  if (b.g().compare(std::string("")) == 0)
    a.f(0) = a.f(1) = 1.0;
  else if (b.g().compare(std::string("")))
    b.g().compare(std::string(""));
  return a;
}

int main()
{
  A a(h(""));
  assert(a._x > 0.0 && a._y > 0.0);
  return 0;
}


Compilation results:

$ g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../src/configure --prefix=/opt/gcc-4.1.1
Thread model: posix
gcc version 4.1.1
$ g++ -W -Wall -O1 testcase.cc      
$ ./a.out
$ g++ -W -Wall -O1 -fstrict-aliasing testcase.cc
$ ./a.out
a.out: testcase.cc:34: int main(): Assertion `a._x > 0.0 && a._y > 0.0' failed.
Aborted


The assertion ceases to fail (with -O1 -fstrict-aliasing) when adding any
(single one) of the options -fno-tree-copy-prop, -fno-tree-dce,
-fno-tree-salias or -fno-inline to the compiler command line.


-- 
           Summary: Unexpected compilation results: -O1 vs. -O1 -fstrict-
                    aliasing
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: heikki dot tauriainen at tkk dot fi
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug c++/30088] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
@ 2006-12-06 17:01 ` heikki dot tauriainen at tkk dot fi
  2006-12-07  7:17 ` bangerth at dealii dot org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: heikki dot tauriainen at tkk dot fi @ 2006-12-06 17:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from heikki dot tauriainen at tkk dot fi  2006-12-06 17:01 -------
Created an attachment (id=12757)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12757&action=view)
Preprocessed source of test case


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug c++/30088] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
  2006-12-06 17:01 ` [Bug c++/30088] " heikki dot tauriainen at tkk dot fi
@ 2006-12-07  7:17 ` bangerth at dealii dot org
  2006-12-07  7:23 ` [Bug tree-optimization/30088] " bangerth at dealii dot org
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: bangerth at dealii dot org @ 2006-12-07  7:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at dealii dot org  2006-12-07 07:17 -------
Confirmed. There are also no warnings with -Wstrict-aliasing.
The code certainly seems ok, so this is either a bug in
gcc or libstdc++...

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-12-07 07:17:26
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
  2006-12-06 17:01 ` [Bug c++/30088] " heikki dot tauriainen at tkk dot fi
  2006-12-07  7:17 ` bangerth at dealii dot org
@ 2006-12-07  7:23 ` bangerth at dealii dot org
  2006-12-27  0:06 ` [Bug tree-optimization/30088] [4.1 Regression] " pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: bangerth at dealii dot org @ 2006-12-07  7:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bangerth at dealii dot org  2006-12-07 07:23 -------
This is a regression from 4.0 and the last 4.1 snapshot I have (which is 
from 20051109 -- I know, I don't get to work on gcc any more :-( ). As per
the reporter's report, the bug has apparently been backported to the 4.1
branch.

I would rate this as a critical wrong-code regression worth looking at by
the aliasing people...

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dberlin at gcc dot gnu dot
                   |                            |org, mmitchel at gcc dot gnu
                   |                            |dot org
          Component|c++                         |tree-optimization
           Keywords|                            |wrong-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (2 preceding siblings ...)
  2006-12-07  7:23 ` [Bug tree-optimization/30088] " bangerth at dealii dot org
@ 2006-12-27  0:06 ` pinskia at gcc dot gnu dot org
  2007-01-25  5:59 ` mmitchel at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-27  0:06 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Unexpected compilation      |[4.1 Regression] Unexpected
                   |results: -O1 vs. -O1 -      |compilation results: -O1 vs.
                   |fstrict-aliasing            |-O1 -fstrict-aliasing
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (3 preceding siblings ...)
  2006-12-27  0:06 ` [Bug tree-optimization/30088] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2007-01-25  5:59 ` mmitchel at gcc dot gnu dot org
  2007-02-05 12:17 ` rguenth at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-01-25  5:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (4 preceding siblings ...)
  2007-01-25  5:59 ` mmitchel at gcc dot gnu dot org
@ 2007-02-05 12:17 ` rguenth at gcc dot gnu dot org
  2007-02-05 12:30 ` rguenth at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 12:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-02-05 12:17 -------
Slightly reduced testcase:

#include <cassert>
#include <string>

struct A
{
  A() : _x(0.0), _y(0.0) { }
  float& f(const int& i) { return (i == 0 ? _x : _y); }
  float _x, _y;
};

A h(const char* s)
{
  A a;
  std::string b("");
  std::string s_(s);
  if (s_.compare(b) == 0)
    a.f(0) = a.f(1) = 1.0;
  else if (std::string(s).compare(std::string("")))
    s_.compare(b);
  return a;
}

int main()
{
  A a(h(""));
  assert(a._x > 0.0 && a._y > 0.0);
  return 0;
}

For some reason we see the stores to a._x and a._y in TMT.89:

  #   TMT.89_678 = V_MAY_DEF <TMT.89_677>;
  a._x = 0.0;
  #   TMT.89_679 = V_MAY_DEF <TMT.89_678>;
  a._y = 0.0;

but later discover they have SFTs (after copyprop1 where we cprop &a._x and
&a._y into the PHI node from the COND_EXPR inlined from A::f()):

  #   SFT.74_209 = V_MAY_DEF <SFT.74_11>;
  #   SFT.75_208 = V_MAY_DEF <SFT.75_9>;
  *D.17209_8 = 1.0e+0;
  #   VUSE <SFT.74_209>;
  #   VUSE <SFT.75_208>;
  D.16796_566 = *D.17209_8;

so this is either (again) a pruning issue or we get it wrong in the sense
that TMT.89 also is used for integer type.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (5 preceding siblings ...)
  2007-02-05 12:17 ` rguenth at gcc dot gnu dot org
@ 2007-02-05 12:30 ` rguenth at gcc dot gnu dot org
  2007-02-05 14:08 ` rguenth at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 12:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-02-05 12:30 -------
We have (alias1):

Type memory tags

TMT.89, UID 17988, struct
basic_string<char,std::char_traits<char>,std::allocator<char> >, is an alias
tag, is addressable, is global, call clobbered
...
TMT.95, UID 17994, float, is addressable, may aliases: { SFT.74 SFT.75 }

a, UID 16758, struct A, is addressable, sub-vars: { SFT.75 SFT.74 }

Variable: SFT.74, UID 17973, float, is addressable, call clobbered, default
def: SFT.74_11, may aliases: { TMT.89 }

Variable: SFT.75, UID 17974, float, is addressable, call clobbered, default
def: SFT.75_9, may aliases: { TMT.89 }


I believe this is all caused because we cannot prove that the string data
cannot point to a.

Note that the testcase passes if you change the signature from A::f() to
get 'i' as value and not reference.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (6 preceding siblings ...)
  2007-02-05 12:30 ` rguenth at gcc dot gnu dot org
@ 2007-02-05 14:08 ` rguenth at gcc dot gnu dot org
  2007-02-05 14:10 ` rguenth at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 14:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2007-02-05 14:07 -------
Created an attachment (id=13008)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13008&action=view)
reduced testcase

This is a reduced testcase (still requires libstdc++ at link time) where you
can see the wrong alias symbols used after copyprop1 with
-O -fstrict-aliasing --param max-aliased-vops=0


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (7 preceding siblings ...)
  2007-02-05 14:08 ` rguenth at gcc dot gnu dot org
@ 2007-02-05 14:10 ` rguenth at gcc dot gnu dot org
  2007-02-05 14:52 ` rguenth at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 14:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from rguenth at gcc dot gnu dot org  2007-02-05 14:10 -------
4.1.0 works, so this is a regression on the branch.  Janis, can you hunt what
broke it?


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janis at gcc dot gnu dot org
           Keywords|                            |alias
      Known to work|                            |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (8 preceding siblings ...)
  2007-02-05 14:10 ` rguenth at gcc dot gnu dot org
@ 2007-02-05 14:52 ` rguenth at gcc dot gnu dot org
  2007-02-14  9:01 ` mmitchel at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-05 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2007-02-05 14:52 -------
Actually the original testcase also fails with 4.1.0.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|4.1.1 4.1.2                 |4.1.0 4.1.1 4.1.2
      Known to work|4.1.0                       |4.0.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (9 preceding siblings ...)
  2007-02-05 14:52 ` rguenth at gcc dot gnu dot org
@ 2007-02-14  9:01 ` mmitchel at gcc dot gnu dot org
  2007-04-25  0:12 ` janis at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (10 preceding siblings ...)
  2007-02-14  9:01 ` mmitchel at gcc dot gnu dot org
@ 2007-04-25  0:12 ` janis at gcc dot gnu dot org
  2007-04-25  0:17 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janis at gcc dot gnu dot org @ 2007-04-25  0:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from janis at gcc dot gnu dot org  2007-04-25 01:11 -------
The test also fails on powerpc-linux, so it's not specific to i686-linux.  The
results seem to be inconsistent, so I'm doing more testing to determine whether
the failure is intermittent.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (11 preceding siblings ...)
  2007-04-25  0:12 ` janis at gcc dot gnu dot org
@ 2007-04-25  0:17 ` pinskia at gcc dot gnu dot org
  2007-11-14 10:00 ` steven at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-25  0:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2007-04-25 01:16 -------
This is most likely related to PR 30567.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |30567


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (12 preceding siblings ...)
  2007-04-25  0:17 ` pinskia at gcc dot gnu dot org
@ 2007-11-14 10:00 ` steven at gcc dot gnu dot org
  2007-11-14 17:51 ` janis at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-11-14 10:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from steven at gcc dot gnu dot org  2007-11-14 10:00 -------
Is this still a problem?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (13 preceding siblings ...)
  2007-11-14 10:00 ` steven at gcc dot gnu dot org
@ 2007-11-14 17:51 ` janis at gcc dot gnu dot org
  2007-11-14 18:36 ` manu at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: janis at gcc dot gnu dot org @ 2007-11-14 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from janis at gcc dot gnu dot org  2007-11-14 17:51 -------
The submitter's testcase fails on powerpc-linux with the current 4.1 and 4.2
branches but has passed on mainline for several months.  In comment #9 I said
that results seemed to be intermittent; if it would be worthwhile I can try
with more revisions between 4.0 and 4.1 to find where it started failing, and
also later dates to find when it stopped failing.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (14 preceding siblings ...)
  2007-11-14 17:51 ` janis at gcc dot gnu dot org
@ 2007-11-14 18:36 ` manu at gcc dot gnu dot org
  2007-12-26 16:17 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2 reichelt at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-14 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from manu at gcc dot gnu dot org  2007-11-14 18:35 -------
(In reply to comment #12)
> The submitter's testcase fails on powerpc-linux with the current 4.1 and 4.2
> branches but has passed on mainline for several months.  In comment #9 I said
> that results seemed to be intermittent; if it would be worthwhile I can try
> with more revisions between 4.0 and 4.1 to find where it started failing, and
> also later dates to find when it stopped failing.

Shouldn't the testcase be added to the testsuite?


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (15 preceding siblings ...)
  2007-11-14 18:36 ` manu at gcc dot gnu dot org
@ 2007-12-26 16:17 ` reichelt at gcc dot gnu dot org
  2007-12-26 16:19 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-12-26 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from reichelt at gcc dot gnu dot org  2007-12-26 16:17 -------
The original testcase fails on i686-pc-linux-gnu with -O2 on the 4.1 branch and
the 4.2 branch.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored
      Known to fail|4.1.0 4.1.1 4.1.2           |4.1.0 4.1.1 4.1.2 4.2.0
                   |                            |4.2.1 4.2.2
            Summary|[4.1 Regression] Unexpected |[4.1/4.2 Regression]
                   |compilation results: -O1 vs.|Unexpected compilation
                   |-O1 -fstrict-aliasing       |results: -O1 vs. -O2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (16 preceding siblings ...)
  2007-12-26 16:17 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2 reichelt at gcc dot gnu dot org
@ 2007-12-26 16:19 ` reichelt at gcc dot gnu dot org
  2007-12-26 16:38 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-12-26 16:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from reichelt at gcc dot gnu dot org  2007-12-26 16:18 -------
*** Bug 33573 has been marked as a duplicate of this bug. ***


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dooglus at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (17 preceding siblings ...)
  2007-12-26 16:19 ` reichelt at gcc dot gnu dot org
@ 2007-12-26 16:38 ` reichelt at gcc dot gnu dot org
  2008-02-04 16:10 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-12-26 16:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from reichelt at gcc dot gnu dot org  2007-12-26 16:37 -------
The following reduced testcase (which should return 0) returns 1 on the 4.1
branch and 4.2 branch when compiled with "-O -fstrict-aliasing" or "-O2" on
i686-pc-linux-gnu:

=======================================================
#include <string>

struct A
{
  float x, y;
  A() : x(), y() {}
  float& foo(const int& i) { return i ? x : y; }
};

int main()
{
  if (!"")
    return 1;
  A a;
  if (!std::string("").compare(std::string("")))
    a.foo(0) = 1;
  else if (std::string("").compare(std::string("")))
    std::string("").compare(std::string(""));
  return !a.y;
}
=======================================================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression]        |[4.1/4.2 Regression]
                   |Unexpected compilation      |Unexpected compilation
                   |results: -O1 vs. -O2        |results: -O1 vs. -O1 -
                   |                            |fstrict-aliasing


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (18 preceding siblings ...)
  2007-12-26 16:38 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing reichelt at gcc dot gnu dot org
@ 2008-02-04 16:10 ` rguenth at gcc dot gnu dot org
  2008-07-04 21:45 ` [Bug tree-optimization/30088] [4.2 " jsm28 at gcc dot gnu dot org
  2009-03-30 19:44 ` jsm28 at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-04 16:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2008-02-04 16:09 -------
Trunk is fine.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.0.3                       |4.0.3 4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (19 preceding siblings ...)
  2008-02-04 16:10 ` rguenth at gcc dot gnu dot org
@ 2008-07-04 21:45 ` jsm28 at gcc dot gnu dot org
  2009-03-30 19:44 ` jsm28 at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 21:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from jsm28 at gcc dot gnu dot org  2008-07-04 21:45 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression]        |[4.2 Regression] Unexpected
                   |Unexpected compilation      |compilation results: -O1 vs.
                   |results: -O1 vs. -O1 -      |-O1 -fstrict-aliasing
                   |fstrict-aliasing            |
   Target Milestone|4.1.3                       |4.2.5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

* [Bug tree-optimization/30088] [4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing
  2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
                   ` (20 preceding siblings ...)
  2008-07-04 21:45 ` [Bug tree-optimization/30088] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 19:44 ` jsm28 at gcc dot gnu dot org
  21 siblings, 0 replies; 23+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from jsm28 at gcc dot gnu dot org  2009-03-30 19:43 -------
Closing 4.2 branch, fixed in 4.3.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|4.1.0 4.1.1 4.1.2 4.2.0     |4.1.0 4.1.1 4.1.2 4.2.0
                   |4.2.1 4.2.2                 |4.2.1 4.2.2 4.2.5
         Resolution|                            |FIXED
   Target Milestone|4.2.5                       |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30088


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

end of thread, other threads:[~2009-03-30 19:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 16:59 [Bug c++/30088] New: Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing heikki dot tauriainen at tkk dot fi
2006-12-06 17:01 ` [Bug c++/30088] " heikki dot tauriainen at tkk dot fi
2006-12-07  7:17 ` bangerth at dealii dot org
2006-12-07  7:23 ` [Bug tree-optimization/30088] " bangerth at dealii dot org
2006-12-27  0:06 ` [Bug tree-optimization/30088] [4.1 Regression] " pinskia at gcc dot gnu dot org
2007-01-25  5:59 ` mmitchel at gcc dot gnu dot org
2007-02-05 12:17 ` rguenth at gcc dot gnu dot org
2007-02-05 12:30 ` rguenth at gcc dot gnu dot org
2007-02-05 14:08 ` rguenth at gcc dot gnu dot org
2007-02-05 14:10 ` rguenth at gcc dot gnu dot org
2007-02-05 14:52 ` rguenth at gcc dot gnu dot org
2007-02-14  9:01 ` mmitchel at gcc dot gnu dot org
2007-04-25  0:12 ` janis at gcc dot gnu dot org
2007-04-25  0:17 ` pinskia at gcc dot gnu dot org
2007-11-14 10:00 ` steven at gcc dot gnu dot org
2007-11-14 17:51 ` janis at gcc dot gnu dot org
2007-11-14 18:36 ` manu at gcc dot gnu dot org
2007-12-26 16:17 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O2 reichelt at gcc dot gnu dot org
2007-12-26 16:19 ` reichelt at gcc dot gnu dot org
2007-12-26 16:38 ` [Bug tree-optimization/30088] [4.1/4.2 Regression] Unexpected compilation results: -O1 vs. -O1 -fstrict-aliasing reichelt at gcc dot gnu dot org
2008-02-04 16:10 ` rguenth at gcc dot gnu dot org
2008-07-04 21:45 ` [Bug tree-optimization/30088] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 19:44 ` jsm28 at gcc dot gnu dot org

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).