Bug 20650 - [4.1 Regression] float.c fails to build with weird error message
Summary: [4.1 Regression] float.c fails to build with weird error message
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Geoff Keating
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-03-26 20:33 UTC by Andreas Tobler
Modified: 2005-04-02 18:58 UTC (History)
4 users (show)

See Also:
Host: powerpc-unknown-linux-gnu
Target: powerpc-unknown-linux-gnu
Build: powerpc-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-03-27 22:32:23


Attachments
preprocessed source. (8.28 KB, text/plain)
2005-03-26 20:34 UTC, Andreas Tobler
Details
preprocessed asm (267 bytes, application/octet-stream)
2005-03-26 20:35 UTC, Andreas Tobler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Tobler 2005-03-26 20:33:37 UTC
float.c from the libffi test suite fails to build on ppc-linux:
/mnt/slice1/gcc-trunk/gcc/libffi/testsuite/libffi.call/float.c: In function
'floating':
:1441796: error: impossible constraint in 'asm'
compiler exited with status 1

[andreas@pm9600 objdir]$ ./gcc/xgcc -v
Using built-in specs.
Target: powerpc-unknown-linux-gnu
Configured with: /mnt/slice1/gcc-trunk/gcc/configure
--prefix=/mnt/slice1/gcc-trunk/testbin --enable-languages=c,c++,java
--disable-multilib --enable-java-awt=gtk,xlib --enable-gtk-cairo
--disable-checking --disable-static
Thread model: posix
gcc version 4.1.0 20050326 (experimental)

I'll attach the .i and .s file
Comment 1 Andreas Tobler 2005-03-26 20:34:55 UTC
Created attachment 8459 [details]
preprocessed source.
Comment 2 Andreas Tobler 2005-03-26 20:35:20 UTC
Created attachment 8460 [details]
preprocessed asm
Comment 3 Andrew Pinski 2005-03-27 22:32:23 UTC
Small testcase:
int f(double a, double b)
{
int a1 = a;
int b1 = b;
  return a1+b1;
}

You can reproduce this on powerpc-darwin with -mcpu=601
Comment 4 Andrew Pinski 2005-03-27 22:34:05 UTC
This was caused by:
2005-03-25  Geoffrey Keating  <geoffk@apple.com>

        * config/rs6000/rs6000.md (UNSPEC constants): Add UNSPEC_STFIWX.
        (fix_truncdfsi2): Allow registers or memory as destination.
        When TARGET_PPC_GFXOPT, generate simplified pattern.
        (fix_truncdfsi2_internal): Use define_insn_and_split.
        (fix_truncdfsi2_internal_gfxopt): New.
        (fctiwz): Don't confuse register allocation by giving it no choices.
        (stfiwx): New.
        * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'Z'.
        (EXTRA_MEMORY_CONSTRAINT): Likewise.
        * config/rs6000/rs6000.c (indexed_or_indirect_operand): New.
        * config/rs6000/rs6000-protos.h (indexed_or_indirect_operand): New.

There are a large number of regressions on powerpc-linux and powerpc-aix because of this change.
20000127-1.c is one of the regressions.
Comment 5 GCC Commits 2005-04-02 09:58:48 UTC
Subject: Bug 20650

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	geoffk@gcc.gnu.org	2005-04-02 09:58:36

Modified files:
	gcc            : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/config/rs6000: rs6000.md 
Added files:
	gcc/testsuite/gcc.dg: rs6000-fpint.c 

Log message:
	PR 20650
	* config/rs6000/rs6000.md (fix_truncdfsi2): Make destination
	a register.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8082&r2=2.8083
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5266&r2=1.5267
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/rs6000/rs6000.md.diff?cvsroot=gcc&r1=1.358&r2=1.359
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/rs6000-fpint.c.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 6 Geoff Keating 2005-04-02 09:59:27 UTC
Should be fixed now.
Comment 7 Andreas Tobler 2005-04-02 18:58:32 UTC
Verified on ppc-linux. Failing tc fixed, thanks.