https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106966

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Christian Ehrhardt from comment #3)
> > Just drop -mbuild-constants.
> 
> Thanks for the hint Uroš, but I'm not sure if one can do that, this option
> is from [1]. I do not have the background on this, but it reads as there was
> a reason "Use -mbuild-constants to prevent the compiler using static data"
> to set this which seems more breaking than my current workaround (reduce -O2
> to -O1).
> 
> [1]:
> https://github.com/qemu/qemu-palcode/commit/
> 0830e72f0bce29bdf1de0d67ad503a9a8b99c968

-mbuild-constants is used here together with -msmall-data (which limits
relocations to the small data area to 16 bits). -mbuild-constants option tries
harder to construct 64-bit constants using arithmetic with immediates instead
of loads from the small data area. So, if the linker does not error out with
relocation overflow, it can be safely omitted.

The fix to the compiler is relatively straightforward, but I have no access to
alpha system any more to properly test the fix (and I have no patience to run
the testsuite on the simulator). The -mbuild-constant option is rarely used,
and the proposed workaround should be safe.

Reply via email to