public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/52831] New: extract_bit_field_1: issue when str_rtx unsafe from target
@ 2012-04-02  9:39 aurelien.buhrig.gcc at gmail dot com
  2012-04-02  9:42 ` [Bug middle-end/52831] " aurelien.buhrig.gcc at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: aurelien.buhrig.gcc at gmail dot com @ 2012-04-02  9:39 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52831
           Summary: extract_bit_field_1: issue when str_rtx unsafe from
                    target
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: aurelien.buhrig.gcc@gmail.com


This bug makes gcc.c-torture/execute/20040625-1.c fail on my private target
port with gcc 4.6.3. Note that it also occurs on trunk during expand, but it
seems to be masked by next passes.

The issue occurs when:
- str_rtx (op0) is not safe from target
- when bitsize > BITS_PER_WORD

Example:

WORD_MODE = HImode
Pmode == ptr_mode == PSImode

extract_bit_field_1 (str_rtx=0x2aaaac15be28, bitsize=32, bitnum=0, unsignedp=1,
packedp=1 '\001', target=0x2aaaac16c880, mode=PSImode, tmode=PSImode, 
    fallback_p=1 '\001')
(gdb) call debug_rtx (str_rtx)
(mem:BLK (reg/v/f:PSI 22 [ s ]) [2 *s_3(D)+0 S4 A8])
(gdb) call debug_rtx (target)
(reg/v/f:PSI 22 [ s ])

Here is the expand log from trunk (see insns 19 and 20):

; s_4 = s_3(D)->next;

(insn 10 9 11 (clobber (reg/v/f:PSI 22 [ s ]))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 11 10 12 (set (reg:QI 25)
        (mem:QI (plus:PSI (reg/v/f:PSI 22 [ s ])
                (const_int 2 [0x2])) [0+2 S1 A8]))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 12 11 13 (set (reg:HI 24)
        (zero_extend:HI (reg:QI 25)))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 13 12 14 (set (reg:HI 26)
        (reg:HI 24))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 14 13 15 (set (reg:HI 26)
        (unspec:HI [
                (reg:HI 26)
            ] 11))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 15 14 16 (set (strict_low_part (subreg:QI (reg:HI 26) 1))
        (const_int 0 [0]))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 16 15 17 (set (reg:QI 28)
        (mem:QI (plus:PSI (reg/v/f:PSI 22 [ s ])
                (const_int 3 [0x3])) [0+3 S1 A8]))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 17 16 18 (set (reg:HI 27)
        (zero_extend:HI (reg:QI 28)))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 18 17 19 (set (reg:HI 29)
        (ior:HI (reg:HI 27)
            (reg:HI 26)))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 19 18 20 (set (subreg:HI (reg/v/f:PSI 22 [ s ]) 2)
        (reg:HI 29))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 20 19 21 (set (reg:QI 31)
        (mem:QI (reg/v/f:PSI 22 [ s ]) [0+0 S1 A8]))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 21 20 22 (set (reg:HI 30)
        (zero_extend:HI (reg:QI 31)))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))

(insn 22 21 23 (set (reg:HI 32)
        (reg:HI 30))
/home/buhrig/work/sdk/gcc/trunk/src/gcc/testsuite/gcc.c-torture/execute/20040625-1.c:8
-1
     (nil))


The provided patch solves the issue by using an intermediate reg, when needed,
before extracting in word mode.


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

* [Bug middle-end/52831] extract_bit_field_1: issue when str_rtx unsafe from target
  2012-04-02  9:39 [Bug middle-end/52831] New: extract_bit_field_1: issue when str_rtx unsafe from target aurelien.buhrig.gcc at gmail dot com
@ 2012-04-02  9:42 ` aurelien.buhrig.gcc at gmail dot com
  2012-04-19  9:24 ` aurelien.buhrig.gcc at gmail dot com
  2021-05-31  2:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: aurelien.buhrig.gcc at gmail dot com @ 2012-04-02  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Aurelien Buhrig <aurelien.buhrig.gcc at gmail dot com> 2012-04-02 09:42:28 UTC ---
Created attachment 27062
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27062
Fix


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

* [Bug middle-end/52831] extract_bit_field_1: issue when str_rtx unsafe from target
  2012-04-02  9:39 [Bug middle-end/52831] New: extract_bit_field_1: issue when str_rtx unsafe from target aurelien.buhrig.gcc at gmail dot com
  2012-04-02  9:42 ` [Bug middle-end/52831] " aurelien.buhrig.gcc at gmail dot com
@ 2012-04-19  9:24 ` aurelien.buhrig.gcc at gmail dot com
  2021-05-31  2:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: aurelien.buhrig.gcc at gmail dot com @ 2012-04-19  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

Aurelien Buhrig <aurelien.buhrig.gcc at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.8.0                       |4.6.3

--- Comment #2 from Aurelien Buhrig <aurelien.buhrig.gcc at gmail dot com> 2012-04-19 09:18:24 UTC ---
Need more information about the bug?
Any comment about the provided patch?


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

* [Bug middle-end/52831] extract_bit_field_1: issue when str_rtx unsafe from target
  2012-04-02  9:39 [Bug middle-end/52831] New: extract_bit_field_1: issue when str_rtx unsafe from target aurelien.buhrig.gcc at gmail dot com
  2012-04-02  9:42 ` [Bug middle-end/52831] " aurelien.buhrig.gcc at gmail dot com
  2012-04-19  9:24 ` aurelien.buhrig.gcc at gmail dot com
@ 2021-05-31  2:27 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-05-31  2:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Aurelien Buhrig from comment #2)
> Need more information about the bug?
> Any comment about the provided patch?

Patches should be sent to gcc-patches@, I don't think this area has changed
since the bug was filed so it might still apply after 9 years.

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

end of thread, other threads:[~2021-05-31  2:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02  9:39 [Bug middle-end/52831] New: extract_bit_field_1: issue when str_rtx unsafe from target aurelien.buhrig.gcc at gmail dot com
2012-04-02  9:42 ` [Bug middle-end/52831] " aurelien.buhrig.gcc at gmail dot com
2012-04-19  9:24 ` aurelien.buhrig.gcc at gmail dot com
2021-05-31  2:27 ` 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).