Bug 84129 - [8 Regression] GCC on AArch32 no longer compiles files which change architectures using in-line assembly.
Summary: [8 Regression] GCC on AArch32 no longer compiles files which change architect...
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 8.0
: P1 normal
Target Milestone: 8.0
Assignee: Not yet assigned to anyone
Keywords: assemble-failure
Depends on:
Reported: 2018-01-30 13:55 UTC by Tamar Christina
Modified: 2018-01-30 14:53 UTC (History)
0 users

See Also:
Target: arm*-*-*
Known to work: 7.3.1
Known to fail: 8.0
Last reconfirmed: 2018-01-30 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Tamar Christina 2018-01-30 13:55:35 UTC
Commit r255468 broke compilation on Arm when in-line assembly is used to switch architectures:

 asm("    .arch armv5te\n");
 void cpu_has_iwmmxt(void)
   int lo;
   int hi;
   __asm__ __volatile__ (
      "mcrr   p0, 0, %2, %3, c0\n"
      : "=r" (lo), "=r" (hi)
      : "r" (0), "r" (0x100));

used to work and now doesn't. This breaks the Linux kernel compilation.
Using the new approach instead of in-line assembly

 #pragma GCC target("arch=armv5te")

results in a cpp warning being emitted when the architecture is changed.
Comment 1 Tamar Christina 2018-01-30 13:56:00 UTC
validating patch to submit upstream.
Comment 2 ktkachov 2018-01-30 14:27:29 UTC
Comment 3 Richard Earnshaw 2018-01-30 14:53:16 UTC
This is programmer error.  Why should the compiler have to understand it being lied to?