public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1
@ 2005-01-24 19:57 Thomas dot Koenig at online dot de
  2005-01-24 19:58 ` [Bug middle-end/19609] " Thomas dot Koenig at online dot de
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-24 19:57 UTC (permalink / raw)
  To: gcc-bugs

I've bootstrapped a gcc tree with the fix for PR 19486 and
flags_complex_divide_method=1 , and found that the code now
confuses the real and complex parts for divisions in certain
cases.

Here's an example:

$ cat complex-a.c
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <complex.h>

int main()
{
    complex float a,b,c;
    a = I;
    b = I;
    c = a/b;
    printf("%f + %f*I\n",crealf(c),cimagf(c));
    return 0;
}
$ gcc complex-a.c
$ ./a.out
0.000000 + 1.000000*I

-- 
           Summary: real and imaginary part interchanged when
                    flags_complex_divide_method=1
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug middle-end/19609] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
@ 2005-01-24 19:58 ` Thomas dot Koenig at online dot de
  2005-01-24 20:00 ` Thomas dot Koenig at online dot de
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-24 19:58 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |18902
              nThis|                            |


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


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

* [Bug middle-end/19609] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
  2005-01-24 19:58 ` [Bug middle-end/19609] " Thomas dot Koenig at online dot de
@ 2005-01-24 20:00 ` Thomas dot Koenig at online dot de
  2005-01-24 21:41 ` pcarlini at suse dot de
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-24 20:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-24 20:00 -------
Added rth to the CC list, added keyword.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org
           Keywords|                            |wrong-code


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


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

* [Bug middle-end/19609] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
  2005-01-24 19:58 ` [Bug middle-end/19609] " Thomas dot Koenig at online dot de
  2005-01-24 20:00 ` Thomas dot Koenig at online dot de
@ 2005-01-24 21:41 ` pcarlini at suse dot de
  2005-01-24 21:49 ` [Bug middle-end/19609] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-24 21:41 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pcarlini at suse dot de


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (2 preceding siblings ...)
  2005-01-24 21:41 ` pcarlini at suse dot de
@ 2005-01-24 21:49 ` pinskia at gcc dot gnu dot org
  2005-01-24 22:23 ` rth at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-24 21:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-24 21:49 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-01-24 21:49:21
               date|                            |
            Summary|real and imaginary part     |[4.0 Regression] real and
                   |interchanged when           |imaginary part interchanged
                   |flags_complex_divide_method=|when
                   |1                           |flags_complex_divide_method=
                   |                            |1


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (3 preceding siblings ...)
  2005-01-24 21:49 ` [Bug middle-end/19609] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2005-01-24 22:23 ` rth at gcc dot gnu dot org
  2005-01-24 23:01 ` pcarlini at suse dot de
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-24 22:23 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-01-24 21:49:21         |2005-01-24 22:23:44
               date|                            |


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (4 preceding siblings ...)
  2005-01-24 22:23 ` rth at gcc dot gnu dot org
@ 2005-01-24 23:01 ` pcarlini at suse dot de
  2005-01-24 23:24 ` rth at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-24 23:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-24 23:01 -------
Hi Richard. It seems to me that the problem is in the implemented formula.

Looking at Goldberg, when |d| >= |c| in its paper,that is |bi| > |br| in the
Gcc code, we should have, at the end of the calculation:

  ((ai + ar*ratio)/div) + i((-ar + ai*ratio)/div)

and *not*:

  ((ar + ai*ratio)/div) + i((ai - ar*ratio)/div)

Indeed, this explanation is consistent with the behavior observed with
the specific testcase.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (5 preceding siblings ...)
  2005-01-24 23:01 ` pcarlini at suse dot de
@ 2005-01-24 23:24 ` rth at gcc dot gnu dot org
  2005-01-24 23:33 ` pcarlini at suse dot de
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-24 23:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-01-24 23:23 -------
Yes, I see that.  My eyes crossed while transcribing the algorithm to trees,
and I failed to notice that a computation is (b - (a * ratio)) in one branch
and ((a * ratio) - b) in the other.  And so incorrectly believed that the 
branches could be rewritten to share code.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (6 preceding siblings ...)
  2005-01-24 23:24 ` rth at gcc dot gnu dot org
@ 2005-01-24 23:33 ` pcarlini at suse dot de
  2005-01-25  1:53 ` pcarlini at suse dot de
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-24 23:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-24 23:33 -------
> Yes, I see that.  My eyes crossed while transcribing the algorithm to trees,
> and I failed to notice that a computation is (b - (a * ratio)) in one branch
> and ((a * ratio) - b) in the other.  And so incorrectly believed that the 
> branches could be rewritten to share code.

Indeed, I can imagine: unfortunately, a few more lines are apparently needed.
Anyway, a lot of people will appreciate this work!

P.S. Beware that both the real and the imaginary part are different in the
two branches ;) The roles of a and b are swapped in both cases.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (7 preceding siblings ...)
  2005-01-24 23:33 ` pcarlini at suse dot de
@ 2005-01-25  1:53 ` pcarlini at suse dot de
  2005-01-25  6:28 ` rth at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25  1:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 01:53 -------
Great! In case you like me to double check a bit, only tomorrow, given my
timezone... Thanks again!

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (8 preceding siblings ...)
  2005-01-25  1:53 ` pcarlini at suse dot de
@ 2005-01-25  6:28 ` rth at gcc dot gnu dot org
  2005-01-25  8:41 ` Thomas dot Koenig at online dot de
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-25  6:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-01-25 06:28 -------
Please do.  I seem to have screwed up the ia64 build as well (user error
on my side), and won't see results until tommorow gmt-8.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (9 preceding siblings ...)
  2005-01-25  6:28 ` rth at gcc dot gnu dot org
@ 2005-01-25  8:41 ` Thomas dot Koenig at online dot de
  2005-01-25  8:49 ` Thomas dot Koenig at online dot de
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25  8:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 08:40 -------
I bootstraped a 20050123 shapshot with the d-19609
patch attached and lags_complex_divide_method=1 on
ia64-unknown-linux-gnu, and I got this bootstrap failure
in libgfortran:

/home/zfkts/gcc-bin/gcc/xgcc -B/home/zfkts/gcc-bin/gcc/
-B/home/zfkts/ia64-unknown-linux-gnu/bin/
-B/home/zfkts/ia64-unknown-linux-gnu/lib/ -isystem
/home/zfkts/ia64-unknown-linux-gnu/include -isystem
/home/zfkts/ia64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I.
-I../../../gcc-4.0-20050123/libgfortran -I.
-iquote../../../gcc-4.0-20050123/libgfortran/io -std=gnu99 -O2 -g -O2 -c
../../../gcc-4.0-20050123/libgfortran/generated/pow_r4_i4.c -o pow_r4_i4.o
>/dev/null 2>&1
../../../gcc-4.0-20050123/libgfortran/generated/pow_c4_i4.c: In function
'pow_c4_i4':
../../../gcc-4.0-20050123/libgfortran/generated/pow_c4_i4.c:44: internal
compiler error: in tree_redirect_edge_and_branch, at tree-cfg.c:4518
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[3]: *** [pow_c4_i4.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/zfkts/gcc-bin/ia64-unknown-linux-gnu/libgfortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/zfkts/gcc-bin/ia64-unknown-linux-gnu/libgfortran'
make[1]: *** [all-target-libgfortran] Error 2
make[1]: Leaving directory `/home/zfkts/gcc-bin'
make: *** [bootstrap] Error 2

I'll check a simple complex division next.

        Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (10 preceding siblings ...)
  2005-01-25  8:41 ` Thomas dot Koenig at online dot de
@ 2005-01-25  8:49 ` Thomas dot Koenig at online dot de
  2005-01-25 10:50 ` pcarlini at suse dot de
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25  8:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 08:48 -------
Same thing:

$ cat cdivide.c
#include <stdio.h>
#include <math.h>
#include <complex.h>

int main()
{
    float complex a,b,c;
    c = a/b;
}

$ ~/gcc-bin/gcc/xgcc -fdump-rtl-all-all -fdump-tree-all -B ~/gcc-bin/gcc/ cdivide.c
cdivide.c: In function 'main':
cdivide.c:9: internal compiler error: in purge_dead_edges, at cfgrtl.c:2460
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
$ cat cdivide.c.t14.oplower

;; Function main (main)

main ()
{
  float D.2722;
  float D.2721;
  float D.2720;
  float D.2719;
  float D.2718;
  float D.2717;
  float D.2716;
  float D.2715;
  float D.2714;
  float D.2713;
  float D.2712;
  float D.2711;
  float D.2710;
  float D.2709;
  float D.2708;
  float D.2707;
  float D.2706;
  float D.2705;
  float D.2704;
  float D.2703;
  float D.2700;
  float D.2699;
  float D.2698;
  float D.2697;
  float D.2696;
  float D.2695;
  complex float c;
  complex float b;
  complex float a;
  complex float D.2690;

<bb 0>:
  D.2695 = REALPART_EXPR <a>;
  D.2696 = IMAGPART_EXPR <a>;
  D.2697 = REALPART_EXPR <b>;
  D.2698 = IMAGPART_EXPR <b>;
  D.2699 = ABS_EXPR <D.2697>;
  D.2700 = ABS_EXPR <D.2698>;
  if (D.2699 < D.2700) goto <L0>; else goto <L1>;

<L0>:;
  D.2705 = D.2697 / D.2698;
  D.2706 = D.2697 * D.2705;
  D.2707 = D.2706 + D.2698;
  D.2708 = D.2695 * D.2705;
  D.2709 = D.2708 + D.2696;
  D.2710 = D.2696 * D.2705;
  D.2711 = D.2710 - D.2695;
  D.2712 = D.2709 / D.2707;
  D.2713 = D.2711 / D.2707;
  D.2703 = D.2712;
  D.2704 = D.2713;

<L1>:;
  D.2714 = D.2698 / D.2697;
  D.2715 = D.2698 * D.2714;
  D.2716 = D.2715 + D.2697;
  D.2717 = D.2696 * D.2714;
  D.2718 = D.2717 + D.2695;
  D.2719 = D.2695 * D.2714;
  D.2720 = D.2696 - D.2719;
  D.2721 = D.2718 / D.2716;
  D.2722 = D.2720 / D.2716;
  D.2703 = D.2721;
  D.2704 = D.2722;

<bb 1>:
  D.2690 = COMPLEX_EXPR <D.2703, D.2704>;
  c = D.2690;
  return;

}


-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (11 preceding siblings ...)
  2005-01-25  8:49 ` Thomas dot Koenig at online dot de
@ 2005-01-25 10:50 ` pcarlini at suse dot de
  2005-01-25 12:40 ` pcarlini at suse dot de
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 10:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 10:49 -------
Hi, everything looks fine here (20050124 on x86-linux), double checked the 
formulas, bootstrapped c, c++, tested a few other divisions besides the
testcase (now ok), and cannot reproduce the last dump of Thomas. The below
is mine, seems ok (e.g., the goto at the end of block L0 is present):

;; Function main (main)

main ()
{
  float D.2643;
  float D.2642;
  float D.2641;
  float D.2640;
  float D.2639;
  float D.2638;
  float D.2637;
  float D.2636;
  float D.2635;
  float D.2634;
  float D.2633;
  float D.2632;
  float D.2631;
  float D.2630;
  float D.2629;
  float D.2628;
  float D.2627;
  float D.2626;
  float D.2625;
  float D.2624;
  float D.2621;
  float D.2620;
  float D.2619;
  float D.2618;
  float D.2617;
  float D.2616;
  complex float c;
  complex float b;
  complex float a;
  complex float D.2611;

<bb 0>:
  D.2616 = REALPART_EXPR <a>;
  D.2617 = IMAGPART_EXPR <a>;
  D.2618 = REALPART_EXPR <b>;
  D.2619 = IMAGPART_EXPR <b>;
  D.2620 = ABS_EXPR <D.2618>;
  D.2621 = ABS_EXPR <D.2619>;
  if (D.2620 < D.2621) goto <L0>; else goto <L1>;

<L0>:;
  D.2626 = D.2618 / D.2619;
  D.2627 = D.2618 * D.2626;
  D.2628 = D.2627 + D.2619;
  D.2629 = D.2616 * D.2626;
  D.2630 = D.2629 + D.2617;
  D.2631 = D.2617 * D.2626;
  D.2632 = D.2631 - D.2616;
  D.2633 = D.2630 / D.2628;
  D.2634 = D.2632 / D.2628;
  D.2624 = D.2633;
  D.2625 = D.2634;
  goto <bb 1>;

<L1>:;
  D.2635 = D.2619 / D.2618;
  D.2636 = D.2619 * D.2635;
  D.2637 = D.2636 + D.2618;
  D.2638 = D.2617 * D.2635;
  D.2639 = D.2638 + D.2616;
  D.2640 = D.2616 * D.2635;
  D.2641 = D.2617 - D.2640;
  D.2642 = D.2639 / D.2637;
  D.2643 = D.2641 / D.2637;
  D.2624 = D.2642;
  D.2625 = D.2643;

<bb 1>:
  D.2611 = COMPLEX_EXPR <D.2624, D.2625>;
  c = D.2611;
  return;

}

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (12 preceding siblings ...)
  2005-01-25 10:50 ` pcarlini at suse dot de
@ 2005-01-25 12:40 ` pcarlini at suse dot de
  2005-01-25 14:50 ` Thomas dot Koenig at online dot de
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 12:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 12:39 -------
Thomas, before attaching stuff to the PR, please double check your setup: on
x86, at least, the problem is definitely fixed and I cannot reproduce your
dumps. I'm currently testing on x86_64.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (13 preceding siblings ...)
  2005-01-25 12:40 ` pcarlini at suse dot de
@ 2005-01-25 14:50 ` Thomas dot Koenig at online dot de
  2005-01-25 15:02 ` pcarlini at suse dot de
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 14:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 14:50 -------
(In reply to comment #13)
> Thomas, before attaching stuff to the PR, please double check your setup: on
> x86, at least, the problem is definitely fixed and I cannot reproduce your
> dumps. I'm currently testing on x86_64.

Paolo,

I just redid the following commands, in order, on an
ia64-unknown-linux-gnu machine:

With the most recent snapshot:

$ bzcat gcc-4.0-20050123.tar.bz2 | tar -xvf -
$ cd gcc-4.0-20050123/
$ cd gcc
$ patch -R < ~/d-19609
$ vi toplev.c

changed 

int flag_complex_divide_method = 1;

$ cd ~/gcc-bin
$ rm -rf *
$ ../gcc-4.0-20050123/configure --prefix=$HOME --enable-languages="c,f95"
$ make -j3 bootstrap

... with the same bootstrap failure.

This setup has never caused problems before.

        Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (14 preceding siblings ...)
  2005-01-25 14:50 ` Thomas dot Koenig at online dot de
@ 2005-01-25 15:02 ` pcarlini at suse dot de
  2005-01-25 15:12 ` Thomas dot Koenig at online dot de
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 15:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 15:01 -------
> I just redid the following commands, in order, on an
> ia64-unknown-linux-gnu machine:
> 
> With the most recent snapshot:
>
> $ bzcat gcc-4.0-20050123.tar.bz2 | tar -xvf -
> 
> ... with the same bootstrap failure.
> 
> This setup has never caused problems before.

This is an ia64 specific issue, therefore: testing on x86 and
x86-64 is ok, and definitely no bootstrap failures.

Also, if you got a bootstrap failure, where did you get those
dumps from?!?

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (15 preceding siblings ...)
  2005-01-25 15:02 ` pcarlini at suse dot de
@ 2005-01-25 15:12 ` Thomas dot Koenig at online dot de
  2005-01-25 15:21 ` pcarlini at suse dot de
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 15:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 15:12 -------
(In reply to comment #15)

> This is an ia64 specific issue, therefore: testing on x86 and
> x86-64 is ok, and definitely no bootstrap failures.

Interesting.  How did you do the testing?  What version did you test
against?  How did you test?  Maybe something is broken in 20050123
that got fixed later, which caused this.

If you could retrace the exact steps I outlined in comment #14,
and still get no failure, then this indeed a target problem.
 
> Also, if you got a bootstrap failure, where did you get those
> dumps from?!?

As you can see from the error messages in comment #9, building
libgfortran failed during "make bootstrap".  Maybe "bootstrap failure"
is not the correct term for this; if so, what is?

        Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (16 preceding siblings ...)
  2005-01-25 15:12 ` Thomas dot Koenig at online dot de
@ 2005-01-25 15:21 ` pcarlini at suse dot de
  2005-01-25 15:40 ` Thomas dot Koenig at online dot de
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 15:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 15:20 -------
> Interesting.  How did you do the testing?  What version did you test
> against?  How did you test?  Maybe something is broken in 20050123
> that got fixed later, which caused this.

Nothing special, just current mainline, applied the patch, changed the
flag to 1, bootstrapped and tested all the languages besides ada. AFAICS,
this is *definitely* a target problem, the patch works fine on x86 and
x86_64.

> As you can see from the error messages in comment #9, building
> libgfortran failed during "make bootstrap".  Maybe "bootstrap failure"
> is not the correct term for this; if so, what is?

It's a normal bootstrap failure during the build of libjava. But in that
case, the bootstrap doesn't complete, indeed. Therefore, how did you get
the last dumps? Of course not using a compiler normally installed! Perhaps
you installed the compiler anyway "by hand" from the build dir, bootstrap
failure notwithstanding?







-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (17 preceding siblings ...)
  2005-01-25 15:21 ` pcarlini at suse dot de
@ 2005-01-25 15:40 ` Thomas dot Koenig at online dot de
  2005-01-25 15:51 ` pcarlini at suse dot de
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 15:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 15:40 -------
(In reply to comment #17)

> Therefore, how did you get
> the last dumps?

I used the xgcc from the build subdirectoy:

$ ~/gcc-bin/gcc/xgcc -fdump-rtl-all-all -fdump-tree-all -B ~/gcc-bin/gcc/ cdivide.c


-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (18 preceding siblings ...)
  2005-01-25 15:40 ` Thomas dot Koenig at online dot de
@ 2005-01-25 15:51 ` pcarlini at suse dot de
  2005-01-25 15:57 ` Thomas dot Koenig at online dot de
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 15:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 15:51 -------
Ok, sorry, didnt' pay attention to that detail (while working on the library,
usually we install the compiler... ;)

Anyway, I'm going to build and test on ia64 too.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (19 preceding siblings ...)
  2005-01-25 15:51 ` pcarlini at suse dot de
@ 2005-01-25 15:57 ` Thomas dot Koenig at online dot de
  2005-01-25 16:01 ` pcarlini at suse dot de
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 15:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 15:57 -------
Paolo,

could you upload the .t14.oplower dump that you got from your working
version with the d-19609 patch?

Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (20 preceding siblings ...)
  2005-01-25 15:57 ` Thomas dot Koenig at online dot de
@ 2005-01-25 16:01 ` pcarlini at suse dot de
  2005-01-25 16:16 ` pcarlini at suse dot de
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 16:01 -------
Is in Comment #11, and looks fine.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (21 preceding siblings ...)
  2005-01-25 16:01 ` pcarlini at suse dot de
@ 2005-01-25 16:16 ` pcarlini at suse dot de
  2005-01-25 16:43 ` Thomas dot Koenig at online dot de
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 16:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 16:13 -------
... indeed, IMH-not-compiler-hacker, opinion, t14 should be the same on x86
and ia64...

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (22 preceding siblings ...)
  2005-01-25 16:16 ` pcarlini at suse dot de
@ 2005-01-25 16:43 ` Thomas dot Koenig at online dot de
  2005-01-25 17:00 ` Thomas dot Koenig at online dot de
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 16:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 16:43 -------
(In reply to comment #22)
> ... indeed, IMH-not-compiler-hacker, opinion, t14 should be the same on x86
> and ia64...

Quite.

Could you maybe run a C-only bootstrap with the 20050123 snapshot,
modified by the patch and setting flags_complex_divide_method=1, and
see wether you can reproduce the problem?  If so, then this has
been fixed by something else in the meantime (which would be
excellent :-)

Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (23 preceding siblings ...)
  2005-01-25 16:43 ` Thomas dot Koenig at online dot de
@ 2005-01-25 17:00 ` Thomas dot Koenig at online dot de
  2005-01-25 17:07 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-25 17:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-25 17:00 -------
#ifdef EGG_ON_FACE_MODE

Sorry to have kept everybody from doing something more worthwile.

The problem was that I hadn't noticed that the patch for
PR 19468 wasn't yet in the 20050123 snapshot which I was
using, and that rth's patch was with respect to mainline,
which contains the PR 19468 patch, which is why PR 19468
crept back in for me, but not for anybody else who was looking
at this.

#endif

So, yes, this is fixed with the attached patch.

        Thomas

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (24 preceding siblings ...)
  2005-01-25 17:00 ` Thomas dot Koenig at online dot de
@ 2005-01-25 17:07 ` pcarlini at suse dot de
  2005-01-25 18:19 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: pcarlini at suse dot de @ 2005-01-25 17:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-01-25 17:06 -------
OK ;) In Italy we say something like "anything is ok, if ends ok" ;)

Anyway, in the meanwhile an ia64-linux bootstrap completed fine here. I'm running
the testsuite now.

-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (25 preceding siblings ...)
  2005-01-25 17:07 ` pcarlini at suse dot de
@ 2005-01-25 18:19 ` cvs-commit at gcc dot gnu dot org
  2005-01-25 18:26 ` rth at gcc dot gnu dot org
  2005-04-20  2:04 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-25 18:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-25 18:19 -------
Subject: Bug 19609

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2005-01-25 18:19:10

Modified files:
	gcc            : ChangeLog tree-complex.c 

Log message:
	PR middle-end/19609
	* tree-complex.c (expand_complex_div_wide): Use the correct formulae.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.7269&r2=2.7270
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-complex.c.diff?cvsroot=gcc&r1=2.17&r2=2.18



-- 


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (26 preceding siblings ...)
  2005-01-25 18:19 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-25 18:26 ` rth at gcc dot gnu dot org
  2005-04-20  2:04 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-25 18:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-01-25 18:26 -------
Fixed.

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


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


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

* [Bug middle-end/19609] [4.0 Regression] real and imaginary part interchanged when flags_complex_divide_method=1
  2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
                   ` (27 preceding siblings ...)
  2005-01-25 18:26 ` rth at gcc dot gnu dot org
@ 2005-04-20  2:04 ` pinskia at gcc dot gnu dot org
  28 siblings, 0 replies; 30+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-20  2:04 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-04-20  2:03 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-24 19:57 [Bug middle-end/19609] New: real and imaginary part interchanged when flags_complex_divide_method=1 Thomas dot Koenig at online dot de
2005-01-24 19:58 ` [Bug middle-end/19609] " Thomas dot Koenig at online dot de
2005-01-24 20:00 ` Thomas dot Koenig at online dot de
2005-01-24 21:41 ` pcarlini at suse dot de
2005-01-24 21:49 ` [Bug middle-end/19609] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-01-24 22:23 ` rth at gcc dot gnu dot org
2005-01-24 23:01 ` pcarlini at suse dot de
2005-01-24 23:24 ` rth at gcc dot gnu dot org
2005-01-24 23:33 ` pcarlini at suse dot de
2005-01-25  1:53 ` pcarlini at suse dot de
2005-01-25  6:28 ` rth at gcc dot gnu dot org
2005-01-25  8:41 ` Thomas dot Koenig at online dot de
2005-01-25  8:49 ` Thomas dot Koenig at online dot de
2005-01-25 10:50 ` pcarlini at suse dot de
2005-01-25 12:40 ` pcarlini at suse dot de
2005-01-25 14:50 ` Thomas dot Koenig at online dot de
2005-01-25 15:02 ` pcarlini at suse dot de
2005-01-25 15:12 ` Thomas dot Koenig at online dot de
2005-01-25 15:21 ` pcarlini at suse dot de
2005-01-25 15:40 ` Thomas dot Koenig at online dot de
2005-01-25 15:51 ` pcarlini at suse dot de
2005-01-25 15:57 ` Thomas dot Koenig at online dot de
2005-01-25 16:01 ` pcarlini at suse dot de
2005-01-25 16:16 ` pcarlini at suse dot de
2005-01-25 16:43 ` Thomas dot Koenig at online dot de
2005-01-25 17:00 ` Thomas dot Koenig at online dot de
2005-01-25 17:07 ` pcarlini at suse dot de
2005-01-25 18:19 ` cvs-commit at gcc dot gnu dot org
2005-01-25 18:26 ` rth at gcc dot gnu dot org
2005-04-20  2:04 ` pinskia 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).