public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/13938] New: ICE when rounding double to long long
@ 2004-01-31  0:16 hebisch at math dot uni dot wroc dot pl
  2004-02-01 19:02 ` [Bug middle-end/13938] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hebisch at math dot uni dot wroc dot pl @ 2004-01-31  0:16 UTC (permalink / raw)
  To: gcc-bugs

The following function:

long long d2ll(double x)
{
        return (long long)(x>0?(x-0.5):(x+0.5));
}

compiled using '-c -O3' options couses ICE:

stystem6.c: In function `d2ll':
stystem6.c:4: internal compiler error: in subst_stack_regs_pat, at reg-stack.c:1430
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

gcc -v gives:
Using built-in specs.
Configured with: ../gcc-20040130/configure --enable-languages=c
Thread model: posix
gcc version 3.5.0 20040130 (experimental)

The problem is present with version from 20040121. The problem is absent
in version from 20040120 (and in earlier versions). Note that the function
above is translation to C of GNU Pascal built-in `round' function. The
problem couses ICE during compilation of GPC `System' unit and in effect
multiple test failures.

-- 
           Summary: ICE when rounding double to long long
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hebisch at math dot uni dot wroc dot pl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
@ 2004-02-01 19:02 ` pinskia at gcc dot gnu dot org
  2004-02-05 10:24 ` zlomek at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-01 19:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-01 19:02 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
      Known to work|                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-02-01 19:02:06
               date|                            |
            Summary|ICE when rounding double to |[3.5 Regression] ICE when
                   |long long                   |rounding double to long long
   Target Milestone|---                         |3.5.0


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
  2004-02-01 19:02 ` [Bug middle-end/13938] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-02-05 10:24 ` zlomek at gcc dot gnu dot org
  2004-02-05 11:25 ` zlomek at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-02-05 10:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-02-05 10:23 -------
This is caused by

2004-01-19  Jan Hubicka  <jh@suse.cz>
        * emit-rtl.c (verify_rtx_sharing, copy_insn_1,
        emit_copy_of_insn_after, emit_copy_of_insn_after): Clobbers
        containing hard regs are shared.
        (gen_hard_reg_clobber): New function.
        (hard_reg_clobbers): New array.
        * genemit.c (gen_exp): Use gen_hard_reg_clobber.
        (copy_rtx): Do not copy clobbers containing hard regs.
        * rtl.h (gen_hard_reg_clobber): Declare.

The problem is that clobber in            

(insn 57 17 59 1 (parallel [
            (set (mem:DI (plus:SI (reg/f:SI 6 bp)
                        (const_int -16 [0xfffffff0])) [0 S8 A8])
                (fix:DI (reg/v:DF 9 st(1) [orig:59 x ] [59])))
            (use (mem:HI (plus:SI (reg/f:SI 6 bp)
                        (const_int -2 [0xfffffffe])) [0 S2 A8]))
            (use (mem:HI (plus:SI (reg/f:SI 6 bp)
                        (const_int -4 [0xfffffffc])) [0 S2 A8]))
            (clobber (reg:DF 9 st(1)))
        ]) 146 {fix_truncdi_memory} (insn_list 17 (insn_list 48 (insn_list 51
(nil))))
    (expr_list:REG_DEAD (reg/v:DF 9 st(1) [orig:59 x ] [59]) 
        (expr_list:REG_UNUSED (reg/v:DF 9 st(1) [orig:59 x ] [59])
            (nil))))

is shared with

(insn 89 23 90 3 (parallel [
            (set (mem:DI (plus:SI (reg/f:SI 6 bp)
                        (const_int -16 [0xfffffff0])) [0 S8 A8])
                (fix:DI (reg:DF 8 st)))
            (use (mem:HI (plus:SI (reg/f:SI 6 bp)
                        (const_int -2 [0xfffffffe])) [0 S2 A8]))
            (use (mem:HI (plus:SI (reg/f:SI 6 bp)
                        (const_int -4 [0xfffffffc])) [0 S2 A8]))
            (clobber (reg:DF 9 st(1)))
        ]) 146 {fix_truncdi_memory} (insn_list 23 (insn_list 85 (insn_list 88
(nil))))
    (expr_list:REG_DEAD (reg:DF 8 st)
        (nil)))

but in the first insn there should be
(clobber (reg/v:DF 9 st(1)))
instead of
(clobber (reg:DF 9 st(1)))

This bug is probably the same as PR/13893

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-02-01 19:02:06         |2004-02-05 10:23:56
               date|                            |


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
  2004-02-01 19:02 ` [Bug middle-end/13938] [3.5 Regression] " pinskia at gcc dot gnu dot org
  2004-02-05 10:24 ` zlomek at gcc dot gnu dot org
@ 2004-02-05 11:25 ` zlomek at gcc dot gnu dot org
  2004-02-06  1:37 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-02-05 11:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-02-05 11:25 -------
Because the reg in clobber (in insn 57) is different to reg in reg_unused note,
find_reg_note can't find it and this causes the ICE.

-- 


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
                   ` (2 preceding siblings ...)
  2004-02-05 11:25 ` zlomek at gcc dot gnu dot org
@ 2004-02-06  1:37 ` pinskia at gcc dot gnu dot org
  2004-02-06  1:38 ` pinskia at gcc dot gnu dot org
  2004-02-07 11:20 ` zlomek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06  1:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 01:37 -------
*** Bug 13839 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at techfak dot uni-
                   |                            |bielefeld dot de


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
                   ` (3 preceding siblings ...)
  2004-02-06  1:37 ` pinskia at gcc dot gnu dot org
@ 2004-02-06  1:38 ` pinskia at gcc dot gnu dot org
  2004-02-07 11:20 ` zlomek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-06  1:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-06 01:38 -------
*** Bug 13893 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin at mpa-garching dot
                   |                            |mpg dot de


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


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

* [Bug middle-end/13938] [3.5 Regression] ICE when rounding double to long long
  2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
                   ` (4 preceding siblings ...)
  2004-02-06  1:38 ` pinskia at gcc dot gnu dot org
@ 2004-02-07 11:20 ` zlomek at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: zlomek at gcc dot gnu dot org @ 2004-02-07 11:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zlomek at gcc dot gnu dot org  2004-02-07 11:20 -------
Fixed by http://gcc.gnu.org/ml/gcc-patches/2004-02/msg00403.html

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


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


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

end of thread, other threads:[~2004-02-07 11:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-31  0:16 [Bug middle-end/13938] New: ICE when rounding double to long long hebisch at math dot uni dot wroc dot pl
2004-02-01 19:02 ` [Bug middle-end/13938] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-02-05 10:24 ` zlomek at gcc dot gnu dot org
2004-02-05 11:25 ` zlomek at gcc dot gnu dot org
2004-02-06  1:37 ` pinskia at gcc dot gnu dot org
2004-02-06  1:38 ` pinskia at gcc dot gnu dot org
2004-02-07 11:20 ` zlomek at gcc dot gnu dot 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).