public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gjl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/60075] New: Wrong code from loop optimizer with address-space accesses
Date: Wed, 05 Feb 2014 13:34:00 -0000	[thread overview]
Message-ID: <bug-60075-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60075
           Summary: Wrong code from loop optimizer with address-space
                    accesses
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org

Created attachment 32046
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32046&action=edit
loop-memx.c: C source triggering the bug

The following C code runs to abort:

== C code ==

typedef unsigned char uint8_t;

volatile uint8_t buf[12];
volatile uint8_t buf_used;

void __attribute__((noinline,noclone))
copy_string (uint8_t len, const __memx char* str)
{
    uint8_t n;

    for (n = 0; n < len; n++)
    {
        if (*str != '1')
            __builtin_abort();
        buf[n] = *str++;
    }

    buf_used = len;
}

int main (void)
{
    copy_string (1, "1");

    return 0;
}

== Command Line ==

$ avr-gcc -mmcu=atmega128 loop-memx.c -O2 -v

== Configuration ==

It's from the current (2014-02-05) 4.7 head but the problem is also known for
official releases like 4.7.2

gcc version 4.7.4 20140205 (prerelease) [gcc-4_7-branch revision 195858] (GCC)

Target: avr
Configured with: ../../gcc.gnu.org/gcc-4_7-branch/configure --target=avr
--prefix=/local/gnu/install/gcc-4.7 --disable-nls --with-dwarf2
--enable-languages=c,c++ --enable-target-optspace=yes --with-avrlibc=yes


             reply	other threads:[~2014-02-05 13:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05 13:34 gjl at gcc dot gnu.org [this message]
2014-02-05 13:37 ` [Bug tree-optimization/60075] " gjl at gcc dot gnu.org
2023-12-05 12:35 ` rguenth 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-60075-4@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).