public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56161] New: label: jmp label bug in 4.8.0-0.7
@ 2013-01-31 11:14 hvtaifwkbgefbaei at gmail dot com
  2013-01-31 11:46 ` [Bug tree-optimization/56161] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hvtaifwkbgefbaei at gmail dot com @ 2013-01-31 11:14 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56161
           Summary: label: jmp label bug in 4.8.0-0.7
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hvtaifwkbgefbaei@gmail.com


Created attachment 29314
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29314
dcraw adobe_coeff.c bug

dcraw function adobe_coeff function with -O1 or higher:

        movw    %ax, black(%rip)        # D.2960, black
.L7:
        movslq  %ebx, %rax      # i, i
        leaq    (%rax,%rax,4), %rax     #, tmp119
        movzwl  table.2869+10(,%rax,8), %eax    # table[i_40].maximum, D.2960
        testw   %ax, %ax        # D.2960
        je      .L8     #,
        movw    %ax, maximum(%rip)      # D.2960, maximum
.L8:
        movslq  %ebx, %rbx      # i, i
        leaq    (%rbx,%rbx,4), %rax     #, tmp126
        cmpw    $0, table.2869+12(,%rax,8)      #, table[i_40].trans
        je      .L5     #,
.L10:
        jmp     .L10    #
.L6:
        addl    $1, %ebx        #, i
        addq    $40, %rbp       #, ivtmp.38
        cmpl    $5, %ebx        #, i
        jne     .L11    #,
.L5:
        addq    $152, %rsp      #,
        .cfi_def_cfa_offset 40
        popq    %rbx    #


here, jmp .L10 is what I do not like very much.
with -fno-tree-dce this code generation bug does not happen.


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

* [Bug tree-optimization/56161] label: jmp label bug in 4.8.0-0.7
  2013-01-31 11:14 [Bug tree-optimization/56161] New: label: jmp label bug in 4.8.0-0.7 hvtaifwkbgefbaei at gmail dot com
@ 2013-01-31 11:46 ` jakub at gcc dot gnu.org
  2013-01-31 12:03 ` jakub at gcc dot gnu.org
  2013-01-31 12:14 ` hvtaifwkbgefbaei at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-01-31 11:46 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-31 11:45:53 UTC ---
  double cam_xyz[4][3];
...
        for (j=0; j < 12; j++)
          cam_xyz[0][j] = table[i].trans[j] / 10000.0;
When using cam_xyz[0][j], this is first converted into a pointer to array of 3
doubles, so cam_xyz[0][3] store (up to cam_xyz[0][11] store) all invoke
undefined behavior.
You just can't initialize a two dimensional array this way.


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

* [Bug tree-optimization/56161] label: jmp label bug in 4.8.0-0.7
  2013-01-31 11:14 [Bug tree-optimization/56161] New: label: jmp label bug in 4.8.0-0.7 hvtaifwkbgefbaei at gmail dot com
  2013-01-31 11:46 ` [Bug tree-optimization/56161] " jakub at gcc dot gnu.org
@ 2013-01-31 12:03 ` jakub at gcc dot gnu.org
  2013-01-31 12:14 ` hvtaifwkbgefbaei at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-01-31 12:03 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-31 12:02:51 UTC ---
Using:
double *cam_xyzp = (double *) &cam_xyz[0][0];

before the loop and using cam_xyzp[j] instead of cam_xyz[0][j]
or using cam_xyz[j/3][j%3] or making cam_xyz one dimensional instead of two
dimensional should fix this.  Dup of PR54136 .


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

* [Bug tree-optimization/56161] label: jmp label bug in 4.8.0-0.7
  2013-01-31 11:14 [Bug tree-optimization/56161] New: label: jmp label bug in 4.8.0-0.7 hvtaifwkbgefbaei at gmail dot com
  2013-01-31 11:46 ` [Bug tree-optimization/56161] " jakub at gcc dot gnu.org
  2013-01-31 12:03 ` jakub at gcc dot gnu.org
@ 2013-01-31 12:14 ` hvtaifwkbgefbaei at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hvtaifwkbgefbaei at gmail dot com @ 2013-01-31 12:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Sami Farin <hvtaifwkbgefbaei at gmail dot com> 2013-01-31 12:13:46 UTC ---
Yes that array access was evil, but I didn't know this kind of things can
happen :)
Hmm seems Venkataramanan forgot to notify dcraw maintainer.. I'll do it now.


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

end of thread, other threads:[~2013-01-31 12:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 11:14 [Bug tree-optimization/56161] New: label: jmp label bug in 4.8.0-0.7 hvtaifwkbgefbaei at gmail dot com
2013-01-31 11:46 ` [Bug tree-optimization/56161] " jakub at gcc dot gnu.org
2013-01-31 12:03 ` jakub at gcc dot gnu.org
2013-01-31 12:14 ` hvtaifwkbgefbaei at gmail dot com

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