[Bug target/84945] [8 Regression] UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift exponent 32 is too large for 32-bit type 'int'

hjl.tools at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 19 12:03:00 GMT 2018


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

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 43696 [details]
> gcc8-pr84945.patch
> 
> Untested fix.
> I think this ought to work well on x86_64/i?86-linux, but I'm afraid is
> going to be an ABI change otherwise, because __cpu_model exported out of
> libgcc will change in that case size and objects referencing it might have
> copy relocations against it.
> 
> Another possibility is not to add the extra features into
> __cpu_model.__cpu_features, but add a new variable (say __cpu_features2),
> and make sure to not add this variable at all into libgcc_s.so.1 (i.e. force
> it to be libgcc.a only), then __builtin_cpu_supports for these new features
> would always link in the libgcc.a(cpuinfo.o).

I like this approach better.


More information about the Gcc-bugs mailing list