[Bug middle-end/39390] [4.4 regression] Bogus aliasing warning with std::set

2009-03-06 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2009-03-06 13:36 ---
Confirmed with the reduced testcase only, at -O2 -Wall.  The warning happens
after PTA triggered by SRA.

Relevant constraints:

__y_7 = &s.64+64
D.2839_21 = __y_7
__x.8_43 = D.2839_21

and code:

  D.2839_21 = &__y_7->D.2545;
  D.2832_22 ={v} &0B->D.2545;
  if (D.2832_22 != 0B)
goto ;
  else
goto ;

:
  D.2888_42 = &__y_7->D.2545;
  if (D.2839_21 == D.2888_42)
goto ;
  else
goto ;

:
  __x.8_43 = (const struct _Rb_tree_node *) D.2839_21;
  D.2878_45 = __x.8_43->_M_value_field;

which shows that the warning is for dead code.  Thus this is not a
wrong-code problem.

VRP could figure out the equivalencies but doesn't.  The next DOM
pass figures out the second but not the first non-equivalency - that
survives until the next forwprop pass.

In the end the problem is that VRP doesn't do a good job cleaning up
after itself (there are single-argument PHIs left after it as well as
non-simplified comparisons):

:
Invalid sum of incoming frequencies 900, should be 1
  # __y_8 = PHI <0B(2)>
  # __y_18 = PHI <__y_7(2)>
...

:
Invalid sum of incoming frequencies 3900, should be 102
  D.2837 = 1;
  D.2839_21 = &__y_18->D.2545;
  D.2832_22 ={v} &0B->D.2545;
  if (D.2832_22 != 0B)
goto ;
  else
goto ;

:
  D.2888_42 = &__y_7->D.2545;
  if (D.2839_21 == D.2888_42)
goto ;
  else
goto ;


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords|wrong-code  |missed-optimization
   Last reconfirmed|-00-00 00:00:00 |2009-03-06 13:36:52
   date||


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



[Bug middle-end/39390] [4.4 regression] Bogus aliasing warning with std::set

2009-03-06 Thread reichelt at gcc dot gnu dot org


--- Comment #2 from reichelt at gcc dot gnu dot org  2009-03-06 13:27 
---
Oops, typo: I meant the bug is triggered with "-O3 -Wall".

The reduced testcase already triggers the warning with "-O2 -Wall" thanks to
some additional "inline"s.


-- 


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



[Bug middle-end/39390] [4.4 regression] Bogus aliasing warning with std::set

2009-03-06 Thread reichelt at gcc dot gnu dot org


--- Comment #1 from reichelt at gcc dot gnu dot org  2009-03-06 13:10 
---
Created an attachment (id=17405)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17405&action=view)
Partially reduced testcase

Somewhat reduced testcase.


-- 


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



[Bug middle-end/39390] [4.4 regression] Bogus aliasing warning with std::set

2009-03-06 Thread reichelt at gcc dot gnu dot org


-- 

reichelt at gcc dot gnu dot org changed:

   What|Removed |Added

   Target Milestone|--- |4.4.0


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