public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
@ 2015-09-09 11:03 mpolacek at gcc dot gnu.org
  2015-09-09 11:09 ` [Bug middle-end/67512] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67512
           Summary: [5/6 Regression] internal compiler error: in
                    invert_tree_comparison, at fold-const.c:2456
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

The following ICEs on x86_64-pc-linux-gnu:

$ ./cc1 -quiet ice.c -O -Wmaybe-uninitialized
ice.c: In function ‘fn1’:
ice.c:9:22: warning: ‘m’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   z = 1 == m ? z : 2 == m;
                      ^
ice.c:4:1: internal compiler error: in invert_tree_comparison, at
fold-const.c:2456
 fn1 (void)
 ^
0xa0288f invert_tree_comparison(tree_code, bool)
        /home/marek/src/gcc/gcc/fold-const.c:2456
0xfb8bb4 pred_equal_p
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:1300
0xfb8cc5 is_pred_expr_subset_of
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:1349
0xfb8eb2 is_pred_chain_subset_of
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:1399
0xfb8f44 is_included_in
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:1428
0xfb8fcd is_superset_of
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:1459
0xfbaaed is_use_properly_guarded
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:2239
0xfbac41 find_uninit_use
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:2283
0xfbae9e warn_uninitialized_phi
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:2353
0xfbb3a7 execute
        /home/marek/src/gcc/gcc/tree-ssa-uninit.c:2463
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


extern int fn2 (void);
extern int fn3 (int);
void
fn1 (void)
{
  int z, m;
  if (1 & m)
    z = fn2 ();
  z = 1 == m ? z : 2 == m;
  fn3 (z);
}
>From gcc-bugs-return-496726-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Sep 09 11:04:24 2015
Return-Path: <gcc-bugs-return-496726-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107150 invoked by alias); 9 Sep 2015 11:04:23 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 107115 invoked by uid 48); 9 Sep 2015 11:04:20 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
Date: Wed, 09 Sep 2015 11:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on target_milestone everconfirmed
Message-ID: <bug-67512-4-wC0ejmmndn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67512-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67512-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg00704.txt.bz2
Content-length: 547

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg512

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-09
   Target Milestone|---                         |5.3
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r219739.


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
@ 2015-09-09 11:09 ` mpolacek at gcc dot gnu.org
  2015-09-09 11:18 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 11:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Here, invert_tree_comparison is asked to return the logical inverse for
BIT_AND_EXPR and crashes on that.


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
  2015-09-09 11:09 ` [Bug middle-end/67512] " mpolacek at gcc dot gnu.org
@ 2015-09-09 11:18 ` mpolacek at gcc dot gnu.org
  2015-09-09 11:55 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(as it should, it is only supposed to handle tcc_comparisons)


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
  2015-09-09 11:09 ` [Bug middle-end/67512] " mpolacek at gcc dot gnu.org
  2015-09-09 11:18 ` mpolacek at gcc dot gnu.org
@ 2015-09-09 11:55 ` mpolacek at gcc dot gnu.org
  2015-09-09 12:58 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
--- a/gcc/tree-ssa-uninit.c
+++ b/gcc/tree-ssa-uninit.c
@@ -1296,7 +1296,8 @@ pred_equal_p (pred_info x1, pred_info x2)
     return false;

   c1 = x1.cond_code;
-  if (x1.invert != x2.invert)
+  if (x1.invert != x2.invert
+      && TREE_CODE_CLASS (x2.cond_code) == tcc_comparison)
     c2 = invert_tree_comparison (x2.cond_code, false);
   else
     c2 = x2.cond_code;

should be enough though I'd like to know what exactly 'invert' in pred_info
means.


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-09-09 11:55 ` mpolacek at gcc dot gnu.org
@ 2015-09-09 12:58 ` mpolacek at gcc dot gnu.org
  2015-09-09 17:10 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 12:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
With the patch we don't ICE anymore but we lose this warning:

ice.c:10:3: warning: ‘z’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   fn3 (z);
   ^
but I think that's not a fault of the patch.
>From gcc-bugs-return-496742-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Sep 09 13:02:41 2015
Return-Path: <gcc-bugs-return-496742-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 115026 invoked by alias); 9 Sep 2015 13:02:40 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 114963 invoked by uid 48); 9 Sep 2015 13:02:36 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/67518] New: [6 Regression] ISL: position out of bounds
Date: Wed, 09 Sep 2015 13:02:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67518-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg00720.txt.bz2
Content-length: 3589

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg518

            Bug ID: 67518
           Summary: [6 Regression] ISL: position out of bounds
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch
  Target Milestone: ---

The testcase below triggers a bug in graphite and leads to:

> gfortran  -c -floop-nest-optimize -O2 -ffast-math bug.f90
/data/vjoost/toolchain-trunk/build/gcc-master/isl/isl_aff.c:944: position out
of bounds
bug.f90:14:0:

  FUNCTION
exp_radius_very_extended(la_min,la_max,lb_min,lb_max,pab,o1,o2,ra,rb,rp,&
^
internal compiler error: Aborted
0xb3f37f crash_signal
        /data/vjoost/toolchain-trunk/build/gcc-master/gcc/toplev.c:352
0x12f9bd2 isl_handle_error
        /data/vjoost/toolchain-trunk/build/gcc-master/isl/isl_ctx.c:96
0x12c4a91 isl_aff_set_coefficient_si
        /data/vjoost/toolchain-trunk/build/gcc-master/isl/isl_aff.c:943
0x1196d7a extract_affine_chrec

/data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite-sese-to-poly.c:600
0x1196d7a extract_affine

/data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite-sese-to-poly.c:788
0x1198354 build_loop_iteration_domains

/data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite-sese-to-poly.c:1024
0x119a7df build_scop_iteration_domain

/data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite-sese-to-poly.c:1389
0x119a7df build_poly_scop(scop*)

/data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite-sese-to-poly.c:3162
0x11872e5 graphite_transform_loops()
        /data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite.c:282
0x1187940 graphite_transforms
        /data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite.c:317
0x1187940 execute
        /data/vjoost/toolchain-trunk/build/gcc-master/gcc/graphite.c:394


> cat bug.f90
MODULE ao_util
    INTEGER, PARAMETER :: dp=8
CONTAINS
  FUNCTION exp_radius(l,alpha,threshold,prefactor,epsin) RESULT(radius)
    REAL(KIND=dp), INTENT(IN)                :: alpha, threshold, prefactor
    REAL(KIND=dp), INTENT(IN), OPTIONAL      :: epsin
    DO
       IF (iter.gt.maxiter) THEN
          CALL stop_program(routineN,moduleN,1,"exceeded")
       ENDIF
    ENDDO
    CALL stop_program(routineN,moduleN,1,"exceeded")
  END FUNCTION exp_radius
 FUNCTION
exp_radius_very_extended(la_min,la_max,lb_min,lb_max,pab,o1,o2,ra,rb,rp,&
                          zetp,eps,prefactor,cutoff,epsin) RESULT(radius)
    REAL(KIND=dp), DIMENSION(:, :), &
      OPTIONAL, POINTER                      :: pab
    REAL(KIND=dp), INTENT(IN)                :: ra(3), rb(3), rp(3), zetp, &
                                                eps, prefactor, cutoff
    REAL(KIND=dp)                            :: bini, binj, coef(0:20), &
                                                epsin_local, polycoef(0:60), &
                                                rad_b, s1, s2
    IF (PRESENT(pab)) THEN
    ENDIF
    DO lxa=0,la_max
    DO lxb=0,lb_max
       coef(0:la_max+lb_max)=0.0_dp
       DO i=0,lxa
          DO j=0,lxb
             coef(lxa+lxb-i-j)=coef(lxa+lxb-i-j) + bini*binj*s1*s2
          ENDDO
       ENDDO
       DO i=0,lxa+lxb
          polycoef(i)=MAX(polycoef(i),coef(i))
       ENDDO
    ENDDO
    ENDDO
    DO i=0,la_max+lb_max
          radius=MAX(radius,exp_radius(i,zetp,eps,polycoef(i),epsin_local) )
    ENDDO
  END FUNCTION exp_radius_very_extended
END MODULE ao_util


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-09-09 12:58 ` mpolacek at gcc dot gnu.org
@ 2015-09-09 17:10 ` mpolacek at gcc dot gnu.org
  2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
  2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 17:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Sep  9 17:09:32 2015
New Revision: 227594

URL: https://gcc.gnu.org/viewcvs?rev=227594&root=gcc&view=rev
Log:
        PR middle-end/67512
        * tree-ssa-uninit.c (pred_equal_p): Only call invert_tree_comparison
        for comparisons.

        * gcc.dg/pr67512.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr67512.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-uninit.c


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
@ 2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Sep  9 17:14:29 2015
New Revision: 227596

URL: https://gcc.gnu.org/viewcvs?rev=227596&root=gcc&view=rev
Log:
        PR middle-end/67512
        * tree-ssa-uninit.c (pred_equal_p): Only call invert_tree_comparison
        for comparisons.

        * gcc.dg/pr67512.c: New test.

Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.dg/pr67512.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/testsuite/ChangeLog
    branches/gcc-5-branch/gcc/tree-ssa-uninit.c


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

* [Bug middle-end/67512] [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456
  2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-09-09 17:10 ` mpolacek at gcc dot gnu.org
@ 2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
  2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-09-09 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-09-09 17:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09 11:03 [Bug middle-end/67512] New: [5/6 Regression] internal compiler error: in invert_tree_comparison, at fold-const.c:2456 mpolacek at gcc dot gnu.org
2015-09-09 11:09 ` [Bug middle-end/67512] " mpolacek at gcc dot gnu.org
2015-09-09 11:18 ` mpolacek at gcc dot gnu.org
2015-09-09 11:55 ` mpolacek at gcc dot gnu.org
2015-09-09 12:58 ` mpolacek at gcc dot gnu.org
2015-09-09 17:10 ` mpolacek at gcc dot gnu.org
2015-09-09 17:15 ` mpolacek at gcc dot gnu.org
2015-09-09 17:15 ` mpolacek 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).