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 middle-end/15825] New: if-cvt optimisation patch noce_try_sign_mask breaks apple-ppc-darwin port


Following patch breaks gcc bootstrap on apple-ppc-darwin. A small test case is attached. Note
that it may not ICE on the FSF mainlline. But it ICEd on a locally built compiler with local
patches. I have also attached the pattern which when presented to noce_try_sign_mask causes
the illegal instruction.

2004-03-09  Roger Sayle  <roger@eyesopen.com>
            Andrew Pinski  <pinskia@physics.uc.edu>

        * ifcvt.c (noce_try_sign_mask): New function to transform
        "x = (y < 0) ? z : 0" into the equivalent "x = (y >> C) & z".
        (noce_process_if_block): Call noce_try_sign_mask.

unsigned int
real_from_integer (long long high, int unsigned_p)
{
      return high < 0 &&  !unsigned_p;
}

/Volumes/sandbox/apple-ppc-lno-merge.bootstrap/gcc/stage1/xgcc -B /Volumes/sandbox/
apple-ppc-lno-merge.bootstrap/gcc/stage1 -O2 -c bad.c
bad.c: In function `real_from_integer':
bad.c:5: error: unrecognizable insn:
(insn:HI 67 66 68 0 (set (reg:SI 132)
        (eq:SI (reg/v:SI 121 [ unsigned_p ])
            (const_int 0 [0x0]))) -1 (nil)
    (expr_list:REG_DEAD (reg/v:SI 121 [ unsigned_p ])
        (nil)))
bad.c:5: internal compiler error: in extract_insn, at recog.c:2068
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

The patter which causes this is:

(insn 61 60 32 2 (parallel [
            (set (reg:SI 118 [ iftmp.0 ])
                (eq:SI (reg/v:SI 121 [ unsigned_p ])
                    (const_int 0 [0x0])))
            (clobber (scratch:SI))
        ]) 413 {*rs6000.md:11584} (nil)
    (expr_list:REG_DEAD (reg/v:SI 121 [ unsigned_p ])
        (expr_list:REG_UNUSED (scratch:SI)
            (nil))))

-- 
           Summary: if-cvt optimisation patch noce_try_sign_mask breaks
                    apple-ppc-darwin port
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fjahanian at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.2.0
  GCC host triplet: powerpc-apple-darwin7.2.0
GCC target triplet: powerpc-apple-darwin7.2.0


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


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