When I compile a testcase that includes float and inline, it asserts internal
compiler error if it is optimized with -O2. If it is optimized with -O, this
error is not asserted.

% gcc -c test.c -O2 -m4
test.c: In function 'fff':
test.c:19: internal compiler error: in reg_overlap_mentioned_p, at
rtlanal.c:1382
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-test case----------------------------
typedef union { float f; int i; } fi_type;

static __inline__ float LOG2(float val)
{
   fi_type num;
   int i;

   num.f = val;
   i = num.i >> 23;
   num.i++;
   return num.f + i;
}

float f;

float fff()
{
   return LOG2(f);
}


-- 
           Summary: [SH4] internal compiler error with inline
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: saito at densan dot co dot jp
 GCC build triplet: sh4-linux
  GCC host triplet: sh4-linux
GCC target triplet: sh4-linux


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

Reply via email to