Thread (21 messages) 21 messages, 8 authors, 2017-12-27

Re: undefined reference to `__multi3' when building with gcc 7.x

From: Thomas Petazzoni <hidden>
Date: 2017-08-05 11:57:59

Hello,

On Sat, 5 Aug 2017 00:25:00 +0200, Ralf Baechle wrote:
quoted
Great! However, looking at the functions that end up calling __multi3,
I'm wondering why suddenly gcc 7.x needs to call such a function, while
the same code was compiling without __multi3 in libgcc with gcc 6.x.  
Chances are it's something specific to MIPS64 R6.  Before trying your
config file I also tried a number of other defconfigs and all built
well.

Here's a test case which generates a reference to __multi3:

unsigned long func(unsigned long a, unsigned long b)
{
        return a > (~0UL) / b;
}

GCC rearanges above statement to:

	return (unsigned __int128)a * (unsigned __int128) b > 0xffffffff;
And this is normal/expected ?

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help