public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-4@http.gcc.gnu.org/bugzilla/>
@ 2014-02-16 13:15 ` jackie.rosen at hushmail dot com
  0 siblings, 0 replies; 11+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:15 UTC (permalink / raw)
  To: gcc-bugs

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

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #11 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2009-12-30 16:15 ` hutchinsonandy at gcc dot gnu dot org
@ 2010-01-29 17:12 ` eric dot weddington at atmel dot com
  4 siblings, 0 replies; 11+ messages in thread
From: eric dot weddington at atmel dot com @ 2010-01-29 17:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from eric dot weddington at atmel dot com  2010-01-29 17:12 -------
Setting Target Milestone.


-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2009-10-24 15:40 ` hutchinsonandy at gcc dot gnu dot org
@ 2009-12-30 16:15 ` hutchinsonandy at gcc dot gnu dot org
  2010-01-29 17:12 ` eric dot weddington at atmel dot com
  4 siblings, 0 replies; 11+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2009-12-30 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hutchinsonandy at gcc dot gnu dot org  2009-12-30 16:14 -------
Fixed on 4.5  - or at least significantly better enough to warrant closure.


-- 

hutchinsonandy at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
  2008-05-29 17:02 ` a dot kaiser at gmx dot net
  2009-10-24 15:37 ` hutchinsonandy at gcc dot gnu dot org
@ 2009-10-24 15:40 ` hutchinsonandy at gcc dot gnu dot org
  2009-12-30 16:15 ` hutchinsonandy at gcc dot gnu dot org
  2010-01-29 17:12 ` eric dot weddington at atmel dot com
  4 siblings, 0 replies; 11+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2009-10-24 15:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hutchinsonandy at gcc dot gnu dot org  2009-10-24 15:39 -------
Subject: Bug 19154

Author: hutchinsonandy
Date: Sat Oct 24 15:39:23 2009
New Revision: 153531

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153531
Log:
        PR middle-end/19154
* avr.md (QIDI): Add new mode iterator.
(sbrx_branch<mode>): Create new zero extract bit, test and jump
patterns for all QI-DI modes combinations.
(sbrx_and_branch<mode>): Create new and based bit test and jump
patterns for QI-SI modes.
avr.c (avr_out_sbxx_branch): Use only bit number.

Modified:
    trunk/gcc/ChangeLog


-- 


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
  2008-05-29 17:02 ` a dot kaiser at gmx dot net
@ 2009-10-24 15:37 ` hutchinsonandy at gcc dot gnu dot org
  2009-10-24 15:40 ` hutchinsonandy at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: hutchinsonandy at gcc dot gnu dot org @ 2009-10-24 15:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hutchinsonandy at gcc dot gnu dot org  2009-10-24 15:36 -------
Subject: Bug 19154

Author: hutchinsonandy
Date: Sat Oct 24 15:36:40 2009
New Revision: 153530

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153530
Log:
PR middle-end/19154
* avr.md (QIDI): Add new mode iterator.
(sbrx_branch<mode>): Create new zero extract bit, test and jump
patterns for all QI-DI modes combinations.
(sbrx_and_branch<mode>): Create new and based bit test and jump
patterns for QI-SI modes.
avr.c (avr_out_sbxx_branch): Use only bit number.

Modified:
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.md


-- 


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
       [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
@ 2008-05-29 17:02 ` a dot kaiser at gmx dot net
  2009-10-24 15:37 ` hutchinsonandy at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: a dot kaiser at gmx dot net @ 2008-05-29 17:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from a dot kaiser at gmx dot net  2008-05-29 17:01 -------
In a similar case I've got the impression that the ifcombine pass might be
responsible for rewriting the "if" into shift and mask. It is rather
questionable whether this really optimizes things for simple targets which jump
faster as they can shift.

I am suprised however, that many optimization strategies can be disabled by
some -fxxx option, but not this one. A first and probably simple approach could
be, to just add such an option.


-- 

a dot kaiser at gmx dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a dot kaiser at gmx dot net


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
  2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
                   ` (3 preceding siblings ...)
  2004-12-25 21:39 ` schlie at comcast dot net
@ 2004-12-25 21:57 ` schlie at comcast dot net
  4 siblings, 0 replies; 11+ messages in thread
From: schlie at comcast dot net @ 2004-12-25 21:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2004-12-25 21:56 -------
Subject: Re:  miss-optimization of (x & pow2C) avr
 conditionals returning bool equivalent values

I apologize, I'm confused, what are you comparing to what?

(are you using 4.0, which to my knowledge only builds with my
recent proposed patches, unless the problem was fixed otherwise?)

- to my understanding, (x & C) should never result in ((x >> C') & 1)
  presented to the backend, as it's purely a target specific optimization.


> From: pinskia at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org>
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-25
> 20:57 -------
> Take:
> char g(char c)
> {
> return (c & (1 << 3)) != 0;
> }
> 
> (insn 8 4 30 (set (reg:HI 24 r24 [orig:44 c ] [44])
>         (sign_extend:HI (reg:QI 24 r24 [ c ]))) 81 {extendqihi2} (nil)
>     (nil))
> 
> (insn 30 8 11 (parallel [
>             (set (reg:HI 24 r24 [orig:44 c ] [44])
>                 (lshiftrt:HI (reg:HI 24 r24 [orig:44 c ] [44])
>                     (const_int 3 [0x3])))
>             (clobber (reg:QI 19 r19))
>         ]) 70 {*lshrhi3_const} (nil)
>     (expr_list:REG_UNUSED (reg:QI 19 r19)
>         (expr_list:REG_UNUSED (reg:QI 25 r25)
>             (nil))))
> 
> (insn 11 30 12 (set (reg:HI 24 r24 [46])
>         (sign_extend:HI (reg:QI 24 r24 [47]))) 81 {extendqihi2}
> (insn_list:REG_DEP_TRUE 10 (nil))
>     (nil))
> (insn 19 16 25 (parallel [
>             (set (reg/i:HI 24 r24 [ <result> ])
>                 (and:HI (reg:HI 24 r24 [46])
>                     (const_int 1 [0x1])))
>             (clobber (scratch:QI))
>         ]) 47 {andhi3} (insn_list:REG_DEP_TRUE 11 (nil))
>     (expr_list:REG_UNUSED (scratch:QI)
>         (nil)))
> 
> 
> Which looks good if the rtl matches up one to one per instruction but since
> avr is not like that we get a
> werid interaction.
> 
> -- 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>      Ever Confirmed|                            |1
>    Last reconfirmed|0000-00-00 00:00:00         |2004-12-25 20:57:17
>                date|                            |
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19154
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.




-- 


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
  2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
                   ` (2 preceding siblings ...)
  2004-12-25 20:57 ` pinskia at gcc dot gnu dot org
@ 2004-12-25 21:39 ` schlie at comcast dot net
  2004-12-25 21:57 ` schlie at comcast dot net
  4 siblings, 0 replies; 11+ messages in thread
From: schlie at comcast dot net @ 2004-12-25 21:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From schlie at comcast dot net  2004-12-25 21:39 -------
Subject: Re:  miss-optimization of (x & pow2C) avr
 conditionals returning bool equivalent values

> I think the issue here is rtx_cost for avr sucks and does not give a good
> accurate cost matrix.

I considered that, and sure it doesn't help; but the form of the conditional
presented for code generation is actually different in otherwise identical
expressions, therefore implying that it's presumed that:

 if ((x >> C') & 1) 1 else 0;  => ((x >> C') & 1)

Is more efficient than:

 if ((x >> C') & 1) 1 else 0; => if (x & C) 1 else 0;

Which is target specific, and should not be presumed, as for targets which
support bit-test&branch:

 if (x & C) 1 else 0; => bit-test&branch x log2C; return 0; return 1;

Is significantly more efficient than a (multi-bit-shift & 1).

(therefore it doesn't seem proper for such return value dependant
assumptions to be made in a target neutral way)





-- 


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
  2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
  2004-12-25 20:34 ` [Bug middle-end/19154] " pinskia at gcc dot gnu dot org
  2004-12-25 20:53 ` pinskia at gcc dot gnu dot org
@ 2004-12-25 20:57 ` pinskia at gcc dot gnu dot org
  2004-12-25 21:39 ` schlie at comcast dot net
  2004-12-25 21:57 ` schlie at comcast dot net
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-25 20:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-25 20:57 -------
Take:
char g(char c)
{
return (c & (1 << 3)) != 0;
}

(insn 8 4 30 (set (reg:HI 24 r24 [orig:44 c ] [44])
        (sign_extend:HI (reg:QI 24 r24 [ c ]))) 81 {extendqihi2} (nil)
    (nil))

(insn 30 8 11 (parallel [
            (set (reg:HI 24 r24 [orig:44 c ] [44])
                (lshiftrt:HI (reg:HI 24 r24 [orig:44 c ] [44])
                    (const_int 3 [0x3])))
            (clobber (reg:QI 19 r19))
        ]) 70 {*lshrhi3_const} (nil)
    (expr_list:REG_UNUSED (reg:QI 19 r19)
        (expr_list:REG_UNUSED (reg:QI 25 r25)
            (nil))))

(insn 11 30 12 (set (reg:HI 24 r24 [46])
        (sign_extend:HI (reg:QI 24 r24 [47]))) 81 {extendqihi2} (insn_list:REG_DEP_TRUE 10 (nil))
    (nil))
(insn 19 16 25 (parallel [
            (set (reg/i:HI 24 r24 [ <result> ])
                (and:HI (reg:HI 24 r24 [46])
                    (const_int 1 [0x1])))
            (clobber (scratch:QI))
        ]) 47 {andhi3} (insn_list:REG_DEP_TRUE 11 (nil))
    (expr_list:REG_UNUSED (scratch:QI)
        (nil)))


Which looks good if the rtl matches up one to one per instruction but since avr is not like that we get a 
werid interaction.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-25 20:57:17
               date|                            |


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
  2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
  2004-12-25 20:34 ` [Bug middle-end/19154] " pinskia at gcc dot gnu dot org
@ 2004-12-25 20:53 ` pinskia at gcc dot gnu dot org
  2004-12-25 20:57 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-25 20:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-25 20:53 -------
I think the issue here is rtx_cost for avr sucks and does not give a good accurate cost matrix.

-- 


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


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

* [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values
  2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
@ 2004-12-25 20:34 ` pinskia at gcc dot gnu dot org
  2004-12-25 20:53 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-25 20:34 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
          Component|c                           |middle-end
  GCC build triplet|powerpc-apple-darwin7.7.0   |
   GCC host triplet|powerpc-apple-darwin7.7.0   |
           Keywords|                            |missed-optimization


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


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

end of thread, other threads:[~2014-02-16 13:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19154-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 13:15 ` [Bug middle-end/19154] miss-optimization of (x & pow2C) avr conditionals returning bool equivalent values jackie.rosen at hushmail dot com
     [not found] <bug-19154-9497@http.gcc.gnu.org/bugzilla/>
2008-05-29 17:02 ` a dot kaiser at gmx dot net
2009-10-24 15:37 ` hutchinsonandy at gcc dot gnu dot org
2009-10-24 15:40 ` hutchinsonandy at gcc dot gnu dot org
2009-12-30 16:15 ` hutchinsonandy at gcc dot gnu dot org
2010-01-29 17:12 ` eric dot weddington at atmel dot com
2004-12-25 20:21 [Bug c/19154] New: " schlie at comcast dot net
2004-12-25 20:34 ` [Bug middle-end/19154] " pinskia at gcc dot gnu dot org
2004-12-25 20:53 ` pinskia at gcc dot gnu dot org
2004-12-25 20:57 ` pinskia at gcc dot gnu dot org
2004-12-25 21:39 ` schlie at comcast dot net
2004-12-25 21:57 ` schlie at comcast dot net

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