public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
@ 2011-04-26 23:46 michael.hope at linaro dot org
2011-04-27 9:43 ` [Bug c/48783] " ams at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: michael.hope at linaro dot org @ 2011-04-26 23:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Summary: ARM: kernel compiled at -O2 has a unused reference to
__aeabi_uldivmod
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: michael.hope@linaro.org
Created attachment 24107
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24107
Preprocessed source
When compiled, the attached code refers to the 64 bit unsigned divmod helper
function '__aeabi_uldivmod' even though the function is never called. This
causes a link error when cross-compiling an ARM Linux 2.6.38 kernel.
To reproduce:
* Make a arm-linux-gnueabi cross compiler configured with --with-mode=thumb
--with-arch=armv7-a --with-tune=cortex-a9 --with-float=softfp --with-fpu=neon
* Compile the attached code with 'arm-linux-gnueabi-gcc -O2 -S wm8974.i'
* See a '.global __aeabi_uldivmod' in the header of wm8974_set_dai_pll
Marking pll_factors() as noinline or putting asm("" : "+r"(source)); before the
call to do_div() works around the problem.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/48783] ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
@ 2011-04-27 9:43 ` ams at gcc dot gnu.org
2011-04-27 9:56 ` michael.hope at linaro dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ams at gcc dot gnu.org @ 2011-04-27 9:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Andrew Stubbs <ams at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ams at gcc dot gnu.org
--- Comment #1 from Andrew Stubbs <ams at gcc dot gnu.org> 2011-04-27 09:15:08 UTC ---
I don't see any call to __aeabi_uldivmod???
I *do* see __aeabi_uidivmod, and that does seem to be called properly.
I get:
.global __aeabi_uidiv
.global __aeabi_uidivmod
.align 2
.thumb
.thumb_func
.type pll_factors, %function
pll_factors:
.fnstart
[.....]
.L54:
ldrb r3, [r6, #0] @ zero_extendqisi2
mov r0, r7
mov r1, r4
bfi r3, r5, #1, #4
strb r3, [r6, #0]
bl __aeabi_uidivmod
movw r5, #52429
movt r5, 52428
mov r0, #167772160
umull r0, r1, r1, r0
[.....]
I can't find a bug here?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/48783] ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
2011-04-27 9:43 ` [Bug c/48783] " ams at gcc dot gnu.org
@ 2011-04-27 9:56 ` michael.hope at linaro dot org
2011-04-27 10:13 ` michael.hope at linaro dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: michael.hope at linaro dot org @ 2011-04-27 9:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
--- Comment #2 from Michael Hope <michael.hope at linaro dot org> 2011-04-27 09:52:09 UTC ---
Sorry, the original attachment included the __attribute__((noinline))
workaround on pll_factors(). Attached is the original that shows the fault.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/48783] ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
2011-04-27 9:43 ` [Bug c/48783] " ams at gcc dot gnu.org
2011-04-27 9:56 ` michael.hope at linaro dot org
@ 2011-04-27 10:13 ` michael.hope at linaro dot org
2011-04-27 11:09 ` ams at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: michael.hope at linaro dot org @ 2011-04-27 10:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
--- Comment #3 from Michael Hope <michael.hope at linaro dot org> 2011-04-27 09:54:56 UTC ---
Created attachment 24111
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24111
Preprocessed source
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/48783] ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (2 preceding siblings ...)
2011-04-27 10:13 ` michael.hope at linaro dot org
@ 2011-04-27 11:09 ` ams at gcc dot gnu.org
2011-05-31 22:31 ` ramana at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ams at gcc dot gnu.org @ 2011-04-27 11:09 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
--- Comment #4 from Andrew Stubbs <ams at gcc dot gnu.org> 2011-04-27 11:08:10 UTC ---
Somewhat reduced testcase:
static void
f (unsigned int a)
{
unsigned long long __res;
if (~0ULL % (a / (a & -a)) == 0)
{
asm ("": "+&r" (__res));
}
}
int
g (unsigned int a)
{
f (a);
}
This gives:
.global __aeabi_uidiv
.global __aeabi_uldivmod
.text
.align 2
.global g
.thumb
.thumb_func
.type g, %function
g:
.fnstart
.LFB1:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
push {lr}
.save {lr}
ldr pc, [sp], #4
.fnend
So, both __aeabi_uidiv and __aeabi_uldivmod are declared global, but neither is
actually used as the code is optimized away.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c/48783] ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (3 preceding siblings ...)
2011-04-27 11:09 ` ams at gcc dot gnu.org
@ 2011-05-31 22:31 ` ramana at gcc dot gnu.org
2012-01-29 4:51 ` [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level pinskia at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-05-31 22:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.31 22:28:11
CC| |ramana at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-05-31 22:28:11 UTC ---
IIUC the problem is because we externalize the label before the functions have
been deleted.
Based on a quick look at the sources, I *think* this comes from the fact that
the default definition of ASM_OUTPUT_EXTERNAL_LIBCALL ends up generating a
.globl symname and somehow don't think this is a port specific problem ( which
I *think* comes from config/elfos.h )
cheers
Ramana
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (4 preceding siblings ...)
2011-05-31 22:31 ` ramana at gcc dot gnu.org
@ 2012-01-29 4:51 ` pinskia at gcc dot gnu.org
2023-01-30 18:40 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-29 4:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |missed-optimization, TREE
Target|Arm |
Last reconfirmed|2011-05-31 22:28:11 |2012-01-28
Component|c |tree-optimization
Summary|ARM: kernel compiled at -O2 |~0ULL % (a / (a & -a)) == 0
|has a unused reference to |is not optimized to false
|__aeabi_uldivmod |on the tree level
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-29 01:44:28 UTC ---
~0ULL % (a / (a & -a)) == 0
Is not optimized to false on the tree level.
Basically we should figure that out and we would then remove the reference to
the uldivmod libcall.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (5 preceding siblings ...)
2012-01-29 4:51 ` [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level pinskia at gcc dot gnu.org
@ 2023-01-30 18:40 ` pinskia at gcc dot gnu.org
2023-01-30 18:43 ` pinskia at gcc dot gnu.org
2023-08-18 13:57 ` jemarch at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-30 18:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |5.1.0
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the reduced testcase in comment #4 has been fixed since GCC 5 but I think
the original issue is still there ...
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (6 preceding siblings ...)
2023-01-30 18:40 ` pinskia at gcc dot gnu.org
@ 2023-01-30 18:43 ` pinskia at gcc dot gnu.org
2023-08-18 13:57 ` jemarch at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-30 18:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
See also thread starting at
https://inbox.sourceware.org/gcc-patches/20221208105944.660323-1-jose.marchesi@oracle.com/
.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
` (7 preceding siblings ...)
2023-01-30 18:43 ` pinskia at gcc dot gnu.org
@ 2023-08-18 13:57 ` jemarch at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jemarch at gcc dot gnu.org @ 2023-08-18 13:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48783
Jose E. Marchesi <jemarch at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jemarch at gcc dot gnu.org
--- Comment #9 from Jose E. Marchesi <jemarch at gcc dot gnu.org> ---
Note https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627864.html
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-08-18 13:57 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-26 23:46 [Bug c/48783] New: ARM: kernel compiled at -O2 has a unused reference to __aeabi_uldivmod michael.hope at linaro dot org
2011-04-27 9:43 ` [Bug c/48783] " ams at gcc dot gnu.org
2011-04-27 9:56 ` michael.hope at linaro dot org
2011-04-27 10:13 ` michael.hope at linaro dot org
2011-04-27 11:09 ` ams at gcc dot gnu.org
2011-05-31 22:31 ` ramana at gcc dot gnu.org
2012-01-29 4:51 ` [Bug tree-optimization/48783] ~0ULL % (a / (a & -a)) == 0 is not optimized to false on the tree level pinskia at gcc dot gnu.org
2023-01-30 18:40 ` pinskia at gcc dot gnu.org
2023-01-30 18:43 ` pinskia at gcc dot gnu.org
2023-08-18 13:57 ` jemarch at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).