public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60075] New: Wrong code from loop optimizer with address-space accesses
@ 2014-02-05 13:34 gjl at gcc dot gnu.org
  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
  0 siblings, 2 replies; 3+ messages in thread
From: gjl at gcc dot gnu.org @ 2014-02-05 13:34 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug tree-optimization/60075] Wrong code from loop optimizer with address-space accesses
  2014-02-05 13:34 [Bug tree-optimization/60075] New: Wrong code from loop optimizer with address-space accesses gjl at gcc dot gnu.org
@ 2014-02-05 13:37 ` gjl at gcc dot gnu.org
  2023-12-05 12:35 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: gjl at gcc dot gnu.org @ 2014-02-05 13:37 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |addr-space, wrong-code
             Target|                            |avr
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-05
     Ever confirmed|0                           |1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
The code is correct of -fno-ivopts or -fno-tree-loop-optimize is added to the
command options.

Presumably, the problem is that the __memx address space uses a 24-bit mode
(PSImode) but sizetype is only 16 bits.


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

* [Bug tree-optimization/60075] Wrong code from loop optimizer with address-space accesses
  2014-02-05 13:34 [Bug tree-optimization/60075] New: Wrong code from loop optimizer with address-space accesses gjl at gcc dot gnu.org
  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
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-05 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2014-02-05 00:00:00         |2023-12-5

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.

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

end of thread, other threads:[~2023-12-05 12:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-05 13:34 [Bug tree-optimization/60075] New: Wrong code from loop optimizer with address-space accesses gjl at gcc dot gnu.org
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

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).