Bug 29611 - Compiler error in inline assembly
Summary: Compiler error in inline assembly
Status: RESOLVED DUPLICATE of bug 27528
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-27 04:13 UTC by Khem Raj
Modified: 2006-10-27 05:23 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: powerpc-*-linux
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
preprocessed testcase (89.29 KB, application/octet-stream)
2006-10-27 05:17 UTC, Khem Raj
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2006-10-27 04:13:37 UTC
While compiling kernel modules of 2.6.18 I hit this error. The testcase in question is attached. This file works all fine with gcc 4.1.2 prerelease. but GCC 4.2.0 prerelease throws the following error message.

test1.c: In function 'unknown_bootoption':
test1.c:15186: warning: asm operand 2 probably doesn't match constraints
test1.c:15186: error: impossible constraint in 'asm'

To reproduce this compile the attached preprocessed file with -O2 -c compile time options. This work ok when -O2 is not used.
Comment 1 Khem Raj 2006-10-27 05:17:12 UTC
Created attachment 12499 [details]
preprocessed testcase
Comment 2 Andrew Pinski 2006-10-27 05:19:09 UTC
   do { __asm__ __volatile__(
        "1:     twi 31,0,0\n"
        ".section __bug_table,\"a\"\n"
        "\t"".long" " ""        1b,%0,%1,%2\n"
        ".previous" : : "i" (241), "i" ("init/main.c"), "i" ((__func__)));
        } while (0);
Comment 3 Andrew Pinski 2006-10-27 05:23:51 UTC
This is not really a bug, since using "i" is not the correct constraint anyways.

*** This bug has been marked as a duplicate of 27528 ***