public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/64621] New: MIssed tail call oppurtunity
@ 2015-01-16  1:26 hubicka at gcc dot gnu.org
  2015-01-16  9:12 ` [Bug middle-end/64621] " rguenth at gcc dot gnu.org
  2015-01-16 18:10 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hubicka at gcc dot gnu.org @ 2015-01-16  1:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64621
           Summary: MIssed tail call oppurtunity
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org

Compiling the following at x86_64:
extern long int strtol (__const char *__restrict __nptr,                        
   char **__restrict __endptr, int __base)                                      
     __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))) ;          
extern __inline int                                                             
__attribute__ ((__nothrow__)) atoi (__const char *__nptr)                       
{                                                                               
  return (int) strtol (__nptr, (char **) ((void *)0), 10);                      
}                                                                               

will not produce tailcall even though it is perfectly possible because of the
extra (int) conversion that is noop and could be ignored.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/64621] MIssed tail call oppurtunity
  2015-01-16  1:26 [Bug middle-end/64621] New: MIssed tail call oppurtunity hubicka at gcc dot gnu.org
@ 2015-01-16  9:12 ` rguenth at gcc dot gnu.org
  2015-01-16 18:10 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-16  9:12 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Well, this really really asks for the function signatures to be updated to the
call ABI at the GIMPLE level...

OTOH, (int) strtol (...) possibly truncates the value so it's not a noop
(it's a noop on i?86 only).


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug middle-end/64621] MIssed tail call oppurtunity
  2015-01-16  1:26 [Bug middle-end/64621] New: MIssed tail call oppurtunity hubicka at gcc dot gnu.org
  2015-01-16  9:12 ` [Bug middle-end/64621] " rguenth at gcc dot gnu.org
@ 2015-01-16 18:10 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-01-16 18:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Well, this really really asks for the function signatures to be updated to
> the
> call ABI at the GIMPLE level...
> 
> OTOH, (int) strtol (...) possibly truncates the value so it's not a noop
> (it's a noop on i?86 only).

Actually it is a NOP on targets which define the upper bits of the register
being undefined when returning.  That includes x86_64 and aarch64.

Thanks,
Andrew Pinski


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-16 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-16  1:26 [Bug middle-end/64621] New: MIssed tail call oppurtunity hubicka at gcc dot gnu.org
2015-01-16  9:12 ` [Bug middle-end/64621] " rguenth at gcc dot gnu.org
2015-01-16 18:10 ` pinskia 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).