public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikpe at it dot uu.se" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/54386] Unaligned mem load wrongly generated for inlined inline/static function
Date: Mon, 29 Oct 2012 22:18:00 -0000	[thread overview]
Message-ID: <bug-54386-4-K3IskbD3Va@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54386-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54386

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #4 from Mikael Pettersson <mikpe at it dot uu.se> 2012-10-29 22:18:16 UTC ---
(In reply to comment #3)
> I've checked this issue again on rev 192482.  It seems to be target
> independent, as it also happens on ARM.
> The following:
> 
> static inline int readint (int* x)
> {
>   return *x;
> }
> 
> int test (int* x)
> {
>   return readint (x);
> }
> 
> compiles to (-O2):
> 
> test:
>         ldrb    r3, [r0]
>     ldrb    r1, [r0, #1]
>     ldrb    r2, [r0, #2]
>     orr    r3, r3, r1, asl #8
>     ldrb    r0, [r0, #3]
>     orr    r3, r3, r2, asl #16
>     orr    r0, r3, r0, asl #24
>     bx    lr

I see this poor code too on armv5tel-linux-gnueabi with 4.8-20121028.
4.7 and 4.6 generate just two instructions for test: a ldr and bx.


  parent reply	other threads:[~2012-10-29 22:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-27 19:05 [Bug middle-end/54386] New: " olegendo at gcc dot gnu.org
2012-09-06 14:50 ` [Bug middle-end/54386] " gjl at gcc dot gnu.org
2012-09-06 16:04 ` olegendo at gcc dot gnu.org
2012-10-29 20:38 ` olegendo at gcc dot gnu.org
2012-10-29 22:18 ` mikpe at it dot uu.se [this message]
2012-10-29 22:23 ` [Bug middle-end/54386] [4.8 Regression] " olegendo at gcc dot gnu.org
2012-10-30  9:05 ` olegendo at gcc dot gnu.org
2012-10-30 19:28 ` mikpe at it dot uu.se
2012-10-31  8:24 ` ebotcazou at gcc dot gnu.org
2012-11-27 20:47 ` [Bug tree-optimization/54386] " jamborm at gcc dot gnu.org
2012-11-30 16:12 ` jamborm at gcc dot gnu.org
2012-12-03 13:28 ` jamborm at gcc dot gnu.org
2012-12-03 13:29 ` jamborm at gcc dot gnu.org
2012-12-03 13:32 ` jamborm at gcc dot gnu.org
2012-12-04  9:53 ` olegendo at gcc dot gnu.org
2013-02-04 22:42 ` olegendo at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-54386-4-K3IskbD3Va@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).