public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
       [not found] <bug-38564-4@http.gcc.gnu.org/bugzilla/>
@ 2011-02-02 22:23 ` pinskia at gcc dot gnu.org
  2011-02-03  9:40 ` rguenther at suse dot de
  2011-02-03 22:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-02 22:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-02 22:22:53 UTC ---
Here is a wrong code with this bug:
int f(void) __attribute__((noclone, noinline));
int g(void) __attribute__((noclone, noinline));
void h(int*) __attribute__((noclone, noinline));
int t = 0;
int a[2];


void h(int *a1)
{
  if(a1 != a+(1-t))
    __builtin_abort();
}
int f(void)
{
  asm("");
  return 1;
}
int g(void)
{
  asm("");
  return 0;
}
int main(void)
{
  int *cur = a;
  while(t<2)
  {
    __SIZE_TYPE__ tt = cur == a;
    int *next = a+tt;
    h(next);
    if(f())
    {
      if (g())
        continue;
      cur = next;
    }
    t++;
  }
}


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
       [not found] <bug-38564-4@http.gcc.gnu.org/bugzilla/>
  2011-02-02 22:23 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block pinskia at gcc dot gnu.org
@ 2011-02-03  9:40 ` rguenther at suse dot de
  2011-02-03 22:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 15+ messages in thread
From: rguenther at suse dot de @ 2011-02-03  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> 2011-02-03 09:40:15 UTC ---
On Wed, 2 Feb 2011, pinskia at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38564
> 
> --- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-02 22:22:53 UTC ---
> Here is a wrong code with this bug:
> int f(void) __attribute__((noclone, noinline));
> int g(void) __attribute__((noclone, noinline));
> void h(int*) __attribute__((noclone, noinline));
> int t = 0;
> int a[2];
> 
> 
> void h(int *a1)
> {
>   if(a1 != a+(1-t))
>     __builtin_abort();
> }
> int f(void)
> {
>   asm("");
>   return 1;
> }
> int g(void)
> {
>   asm("");
>   return 0;
> }
> int main(void)
> {
>   int *cur = a;
>   while(t<2)
>   {
>     __SIZE_TYPE__ tt = cur == a;
>     int *next = a+tt;
>     h(next);
>     if(f())
>     {
>       if (g())
>         continue;
>       cur = next;
>     }
>     t++;
>   }
> }

You mean still broken or fixed with the fix for this patch?
Can you add it as a testcase?

Thanks,
Richard.


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
       [not found] <bug-38564-4@http.gcc.gnu.org/bugzilla/>
  2011-02-02 22:23 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block pinskia at gcc dot gnu.org
  2011-02-03  9:40 ` rguenther at suse dot de
@ 2011-02-03 22:26 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-02-03 22:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-02-03 22:26:10 UTC ---
On Thu, Feb 3, 2011 at 1:40 AM, Richard Guenther <rguenther@suse.de> wrote:
> You mean still broken or fixed with the fix for this patch?
> Can you add it as a testcase?

The patch fixes this testcase, I will add the testcase in a little
bit; just for record tree-ssa-ccp was showing the issue.

Thanks,
Andrew Pinski


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2008-12-30 10:32 ` rguenth at gcc dot gnu dot org
@ 2010-04-27 12:17 ` rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-04-27 12:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2010-04-27 12:16 -------
Subject: Bug 38564

Author: rguenth
Date: Tue Apr 27 12:15:53 2010
New Revision: 158782

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158782
Log:
2010-04-27  Richard Guenther  <rguenther@suse.de>

        Backport from mainline
        2008-12-29  Richard Guenther  <rguenther@suse.de>

        PR middle-end/38564
        * fold-const.c (fold_comparison): Use the correct result type.

        * gcc.c-torture/compile/pr38564.c: New testcase.
        * g++.dg/other/pr40561.C: Likewise.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/other/pr40561.C
    branches/gcc-4_3-branch/gcc/testsuite/gcc.c-torture/compile/pr38564.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/fold-const.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-12-30 10:30 ` rguenth at gcc dot gnu dot org
@ 2008-12-30 10:32 ` rguenth at gcc dot gnu dot org
  2010-04-27 12:17 ` rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-30 10:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2008-12-30 10:30 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-12-29 19:56 ` rguenth at gcc dot gnu dot org
@ 2008-12-30 10:30 ` rguenth at gcc dot gnu dot org
  2008-12-30 10:32 ` rguenth at gcc dot gnu dot org
  2010-04-27 12:17 ` rguenth at gcc dot gnu dot org
  11 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-30 10:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from rguenth at gcc dot gnu dot org  2008-12-30 10:29 -------
Subject: Bug 38564

Author: rguenth
Date: Tue Dec 30 10:28:01 2008
New Revision: 142961

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142961
Log:
2008-12-30  Richard Guenther  <rguenther@suse.de>

        PR middle-end/38564
        * fold-const.c (fold_comparison): Use the correct result type.

        * gcc.c-torture/compile/pr38564.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr38564.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-12-29 17:56 ` rguenth at gcc dot gnu dot org
@ 2008-12-29 19:56 ` rguenth at gcc dot gnu dot org
  2008-12-30 10:30 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 19:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2008-12-29 19:55 -------
fold_binary (EQ_EXPR, int, &state, &state) returns a _Bool 1.  Oops.  I have
a patch.


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-12-23 18:52 ` steven at gcc dot gnu dot org
@ 2008-12-29 17:56 ` rguenth at gcc dot gnu dot org
  2008-12-29 19:56 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-29 17:56 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-12-18 02:09:04         |2008-12-29 17:54:22
               date|                            |


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-12-23 18:21 ` steven at gcc dot gnu dot org
@ 2008-12-23 18:52 ` steven at gcc dot gnu dot org
  2008-12-29 17:56 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-12-23 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from steven at gcc dot gnu dot org  2008-12-23 18:51 -------
Hack demonstrates the problem:

Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c      (revision 142907)
+++ tree-ssa-pre.c      (working copy)
@@ -3274,6 +3274,17 @@ do_regular_insertion (basic_block block, basic_blo
                }
              else
                {
+                 /* For PRE of comparisons, we have to make sure
+                    that the result is of the proper type.  */
+                 if (edoubleprime->kind == CONSTANT
+                     && expr->kind == NARY
+                     && TREE_CODE_CLASS (PRE_EXPR_NARY (expr)->opcode)
+                        == tcc_comparison)
+                   {
+                     PRE_EXPR_CONSTANT (edoubleprime) =
+                       fold_convert (get_expr_type (expr),
+                                     PRE_EXPR_CONSTANT (edoubleprime));
+                   }
                  avail[bprime->index] = edoubleprime;
                  by_some = true;
                  if (first_s == NULL)


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-12-23 17:57 ` pinskia at gcc dot gnu dot org
@ 2008-12-23 18:21 ` steven at gcc dot gnu dot org
  2008-12-23 18:52 ` steven at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: steven at gcc dot gnu dot org @ 2008-12-23 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from steven at gcc dot gnu dot org  2008-12-23 18:19 -------
The problem is that phi_translate returns an expression "eprime" of a different
type.  For the test case of comment #6, we phi_translate
"(eq_expr,&state,obj_1)" to "(bool)1".


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-12-23 17:22 ` hjl dot tools at gmail dot com
@ 2008-12-23 17:57 ` pinskia at gcc dot gnu dot org
  2008-12-23 18:21 ` steven at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-23 17:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2008-12-23 17:55 -------
*** Bug 38608 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-12-23 17:20 ` hjl dot tools at gmail dot com
@ 2008-12-23 17:22 ` hjl dot tools at gmail dot com
  2008-12-23 17:57 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-12-23 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2008-12-23 17:17 -------
*** Bug 38608 has been marked as a duplicate of this bug. ***


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
  2008-12-18  6:00 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused " hjl dot tools at gmail dot com
  2008-12-18  8:14 ` jakub at gcc dot gnu dot org
@ 2008-12-23 17:20 ` hjl dot tools at gmail dot com
  2008-12-23 17:22 ` hjl dot tools at gmail dot com
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-12-23 17:20 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 563 bytes --]



------- Comment #6 from hjl dot tools at gmail dot com  2008-12-23 17:19 -------
Another testcase from PR 38608:

--
int dialog_calendar(int state)
{
  int *obj = (state == 1 ? &state : 0);
  return (obj == &state);
}
---
It failed to -O2:

/tmp/y.c: In function ‘dialog_calendar’:
/tmp/y.c:1: internal compiler error: in insert_into_preds_of_block, at
tree-ssa-pre.c:3131
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
  2008-12-18  6:00 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused " hjl dot tools at gmail dot com
@ 2008-12-18  8:14 ` jakub at gcc dot gnu dot org
  2008-12-23 17:20 ` hjl dot tools at gmail dot com
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-12-18  8:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-12-18 08:13 -------
struct S
{
  struct S *n, *p;
} *s;

void bar (void *);

int
foo (int x)
{
  struct S p = { &p, &p };
  int i;
  for (i = 0; i < x; i++)
    bar (s);
  return p.n == &p;
}

I guess the reason is that unlike tcc_binary the result of tcc_comparison is
bool, not necessarily equal to the type of its operands.  So it can't be
handled exactly like tcc_binary.


-- 


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


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

* [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block
  2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
@ 2008-12-18  6:00 ` hjl dot tools at gmail dot com
  2008-12-18  8:14 ` jakub at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-12-18  6:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2008-12-18 05:57 -------
It is caused by revision 142662:

http://gcc.gnu.org/ml/gcc-patches/2008-12/msg00686.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com, rguenth at gcc dot gnu
                   |                            |dot org
            Summary|[4.4 Regression] ICE in     |[4.4 Regression] Revision
                   |insert_into_preds_of_block  |142662 caused ICE in
                   |                            |insert_into_preds_of_block


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


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

end of thread, other threads:[~2011-02-03 22:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-38564-4@http.gcc.gnu.org/bugzilla/>
2011-02-02 22:23 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused ICE in insert_into_preds_of_block pinskia at gcc dot gnu.org
2011-02-03  9:40 ` rguenther at suse dot de
2011-02-03 22:26 ` pinskia at gcc dot gnu.org
2008-12-18  1:51 [Bug tree-optimization/38564] New: " daney at gcc dot gnu dot org
2008-12-18  6:00 ` [Bug tree-optimization/38564] [4.4 Regression] Revision 142662 caused " hjl dot tools at gmail dot com
2008-12-18  8:14 ` jakub at gcc dot gnu dot org
2008-12-23 17:20 ` hjl dot tools at gmail dot com
2008-12-23 17:22 ` hjl dot tools at gmail dot com
2008-12-23 17:57 ` pinskia at gcc dot gnu dot org
2008-12-23 18:21 ` steven at gcc dot gnu dot org
2008-12-23 18:52 ` steven at gcc dot gnu dot org
2008-12-29 17:56 ` rguenth at gcc dot gnu dot org
2008-12-29 19:56 ` rguenth at gcc dot gnu dot org
2008-12-30 10:30 ` rguenth at gcc dot gnu dot org
2008-12-30 10:32 ` rguenth at gcc dot gnu dot org
2010-04-27 12:17 ` rguenth 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).