Bug 55777 - Inlining nomips16 function into mips16 function can result in undefined builtins
Summary: Inlining nomips16 function into mips16 function can result in undefined builtins
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: rsandifo@gcc.gnu.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 17:02 UTC by Steve Ellcey
Modified: 2013-05-25 16:05 UTC (History)
2 users (show)

See Also:
Host:
Target: mips*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-05-25 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Ellcey 2012-12-21 17:02:34 UTC
While looking at the GCC testresults compiled with -mips16 I found that
gcc.target/mips/mips32-dsp-run.c failed.  Further investigation resulted
in this cutdown testcase:


long long a64_r;
unsigned int ui32_a, ui32_b;

__attribute__((nomips16)) int foo() {
a64_r = __builtin_mips_multu (ui32_a, ui32_b);
}

main ()
{
	foo();
}


Compiling with -O3 -mips16 results in:

gcc -mips16 -O3 builtin.c
/local/home/sellcey/nightly_full/install-mips-mti-elf/lib/gcc/mips-mti-elf/4.8.0/../../../../mips-mti-elf/bin/ld: warning: cannot find entry symbol __start; defaulting to 0000000000400098
/tmp/ccrfai7t.o: In function `foo':
builtin.c:(.text+0x10): undefined reference to `__builtin_mips_multu'
collect2: error: ld returned 1 exit status

Inlining a function with the nomips16 attribute into a function that does
not have that attribute seems to be the cause of the problem.
Comment 1 Steve Ellcey 2013-01-14 21:34:09 UTC
gcc.target/mips/mips32-dspr2.c fails for the same reason.
Comment 2 rsandifo@gcc.gnu.org 2013-05-25 08:53:27 UTC
Testing a patch.
Comment 3 rsandifo@gcc.gnu.org 2013-05-25 16:05:38 UTC
Fixed on trunk.