This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/32533] [4.2 regression] miscompilation at -O3 -ffast-math -ftree-vectorize -march=native



------- Comment #1 from ubizjak at gmail dot com  2007-06-28 08:13 -------
Looks like problems in tree ifcvt pass. Before ifcvt, we have:

  M.2_16 = (int4) D.1257_15;
  if (M.2_16 > 1) goto <L7>; else goto <L9>;

<L7>:;
  if (M.2_16 > 20) goto <L10>; else goto <L9>;

  # M.2_64 = PHI <M.2_16(6), 1(5)>;
<L9>:;
  pretmp.118_78 = (real8) M.2_64;

  # prephitmp.119_79 = PHI <2.0e+1(6), pretmp.118_78(7)>;
  # M.2_4 = PHI <20(6), M.2_64(7)>;
<L10>:;

But ifcvt creates:

  D.1446_84 = M.2_16 > 1;
  D.1447_85 = M.2_16 > 20;
  _ifc_.127_86 = D.1446_84 && D.1447_85;
  D.1449_87 = M.2_16 > 1;
  D.1450_88 = M.2_16 <= 20;
  _ifc_.128_89 = D.1449_87 && D.1450_88;
  M.2_64 = M.2_16 > 1 ? M.2_16 : 1;
  pretmp.118_78 = (real8) M.2_64;
  prephitmp.119_79 = M.2_16 > 1 ? 2.0e+1 : pretmp.118_78;
  M.2_4 = M.2_16 > 1 ? 20 : M.2_64;

Note the last two lines, where we compare "M.2_16 > 1" instead of "M.2_16 >
20".

This bug could be hidden in 4.3.0 as we use MIN_EXPR and MAX_EXPR here.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|middle-end                  |tree-optimization
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-28 08:13:14
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]