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

            Bug ID: 57503
           Summary: [4.7/4.8 Regression] Expand uses wrong multiply
                    routine
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
            Target: avr

Created attachment 30241
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30241&action=edit
cecky.c

== Test case ==

#include <stdlib.h>

long __attribute__((__noinline__))
rot (unsigned char v)
{
    unsigned vs = v * 255;
    return (long) vs * 254;
}

int main (void)
{
    long r = rot (129);

    if (r != 8355330)
        abort();
    exit (0);
}

This program hits abort if compiled with 4.7.2 or 4.8.0.

== Command line ==

avr-gcc -mmcu=atmega168 cecky.c -Os -save-temps -dp -funsigned-char -o
cecky.elf -fdump-rtl-expand-details

== Configure == 

Configured with: ../../gcc.gnu.org/gcc-4_7-branch/configure --target=avr
--prefix=/local/gnu/install/gcc-4.7 --enable-languages=c,c++ --disable-nls
--disable-shared --with-dwarf2 --with-avrlibc=yes

Reply via email to