public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/30816]  New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
@ 2007-02-16  1:21 tobi at gcc dot gnu dot org
  2007-02-16  1:25 ` [Bug middle-end/30816] " tobi at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-16  1:21 UTC (permalink / raw)
  To: gcc-bugs

The testcase started to fail recently, I'm not sure if this points to a bug in
gcc or mpfr.  CCing Kaveh, as it's probably one of his mpfr patches that caused
this.  Here's a debug run:

tobias-schluters-computer:~/src/dev tobi$ uname -a
Darwin tobias-schluters-computer.local 8.8.3 Darwin Kernel Version 8.8.3: Wed
Oct 18 21:57:10 PDT 2006; root:xnu-792.15.4.obj~4/RELEASE_I386 i386 i386
tobias-schluters-computer:~/src/dev tobi$ gdb ../pristine/build/gcc/f951       
GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:10:58 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared lib
aries ..... done

(gdb) run intrinsic-unix-erf.f -O
Starting program: /Users/tobi/src/pristine/build/gcc/f951 intrinsic-unix-erf.f 
O
Reading symbols for shared libraries ..+++ done
 MAIN__ failure c_r c_d
Analyzing compilation unit
Performing interprocedural optimizations
 <visibility> <early_local_cleanups>init2.c:51:  assertion failed: p >= 2 && p 
= ((mpfr_prec_t)((mpfr_prec_t)(~(mpfr_prec_t)0)>>1))

Program received signal SIGABRT, Aborted.
0x9003d1dc in kill ()
(gdb) bt
#0  0x9003d1dc in kill ()
#1  0x9010f2af in raise ()
#2  0x9010de02 in abort ()
#3  0x4233eb70 in mpfr_assert_fail (filename=0x42348c60 "init2.c", linenum=51, 
xpr=0x42348a9c "p >= 2 && p <= ((mpfr_prec_t)((mpfr_prec_t)(~(mpfr_prec_t)0)>>1
)") at mpfr-gmp.c:305
#4  0x42337d75 in mpfr_init2 (x=0xbffff1f0, p=2147483685) at init2.c:51
#5  0x4233d218 in mpfr_erf (y=0xbffff25c, x=0xbffff25c, rnd_mode=GMP_RNDN) at e
f.c:130
(gdb)


-- 
           Summary: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with
                    optimization
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tobi at gcc dot gnu dot org
  GCC host triplet: darwin-i386


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
@ 2007-02-16  1:25 ` tobi at gcc dot gnu dot org
  2007-02-16  1:30 ` tobi at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-16  1:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tobi at gcc dot gnu dot org  2007-02-16 01:25 -------
My mpfr is version 2.2.1 as distributed by fink.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
  2007-02-16  1:25 ` [Bug middle-end/30816] " tobi at gcc dot gnu dot org
@ 2007-02-16  1:30 ` tobi at gcc dot gnu dot org
  2007-02-16  3:44 ` ghazi at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-16  1:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tobi at gcc dot gnu dot org  2007-02-16 01:30 -------
One more thing: I'm fairly sure the bug didn't appear with r118042 where erf
handling via mpfr was introduced.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
  2007-02-16  1:25 ` [Bug middle-end/30816] " tobi at gcc dot gnu dot org
  2007-02-16  1:30 ` tobi at gcc dot gnu dot org
@ 2007-02-16  3:44 ` ghazi at gcc dot gnu dot org
  2007-02-16  3:53 ` kargl at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-16  3:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ghazi at gcc dot gnu dot org  2007-02-16 03:44 -------
I'll try to help but I don't think this has anything to do with my patches. 
Fortran was using mpfr for evaluating intrinsics way before I touched anything,
and I believe it uses it's own historical mechanism from it's frontend for
accessing mpfr, unrelated to the middle-end builtins which I added.

Some thoughts:

1.  I don't see the error on sparc-sun-solaris2.10 (as of yesterday), and I
can't find any other recent testresults that have the problem besides
ppc-darwin.  It may be darwin-specific.

2.  Please include a longer backtrace.  This will help answer whether mpfr_erf
is called from the middle end (my stuff) or from the fortran frontend.

3.  I'm suspicious about the mpfr you grabbed.  Try building mpfr yourself from
source and run it's testsuite to make sure it's healthy.  Then link gcc with
that and retry.  I seem to recall Geoff had some problems on the darwin
regression tester and had to build mpfr using cpu type "none".  My memory of
this is kind of foggy from many months ago.  So I'm not sure really, but a
miscompiled mpfr would be my first guess.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-02-16  3:44 ` ghazi at gcc dot gnu dot org
@ 2007-02-16  3:53 ` kargl at gcc dot gnu dot org
  2007-02-16  5:08 ` ghazi at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: kargl at gcc dot gnu dot org @ 2007-02-16  3:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from kargl at gcc dot gnu dot org  2007-02-16 03:53 -------
(In reply to comment #3)
> I'll try to help but I don't think this has anything to do with my patches. 
> Fortran was using mpfr for evaluating intrinsics way before I touched anything,
> and I believe it uses it's own historical mechanism from it's frontend for
> accessing mpfr, unrelated to the middle-end builtins which I added.

gfortran doesn't constant fold erf.  This is due to your patch and
the fact that Tobi is using darwin.


> 1.  I don't see the error on sparc-sun-solaris2.10 (as of yesterday), and I
> can't find any other recent testresults that have the problem besides
> ppc-darwin.  It may be darwin-specific.

This is my best guess.  Consider

program j
  x = erf(1.5)
end program j


With a 4.2 gfortran prior to your patches, -fdump-tree-original gives

MAIN__ ()
{
  real4 x;

  _gfortran_set_std (70, 127, 0);
  x = __builtin_erff (1.5e+0);
}

With a fairly up to date trunk with your patch, I get

MAIN__ ()
{
  real4 x;

  _gfortran_set_std (70, 127, 0, 0);
  x = 9.66105163097381591796875e-1;
}


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu dot org


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-02-16  3:53 ` kargl at gcc dot gnu dot org
@ 2007-02-16  5:08 ` ghazi at gcc dot gnu dot org
  2007-02-16  5:16 ` ghazi at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-16  5:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ghazi at gcc dot gnu dot org  2007-02-16 05:08 -------
(In reply to comment #3)
> 3.  I'm suspicious about the mpfr you grabbed.  Try building mpfr yourself from
> source and run it's testsuite to make sure it's healthy.  Then link gcc with
> that and retry.  I seem to recall Geoff had some problems on the darwin
> regression tester and had to build mpfr using cpu type "none".  My memory of
> this is kind of foggy from many months ago.  So I'm not sure really, but a
> miscompiled mpfr would be my first guess.

Here's the old message I recalled:
http://gcc.gnu.org/ml/gcc/2006-10/msg00640.html
it says you have to configure GMP with --host=none-apple-darwin
I assume you should do the same configure flag with MPFR.

What version of GMP are you using and where did you get it?
You may have a buggy GMP or MPFR, not sure which.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-02-16  5:08 ` ghazi at gcc dot gnu dot org
@ 2007-02-16  5:16 ` ghazi at gcc dot gnu dot org
  2007-02-16 13:32 ` tobi at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-16  5:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ghazi at gcc dot gnu dot org  2007-02-16 05:16 -------
(In reply to comment #4)
> [...] It may be darwin-specific.
> This is my best guess.  Consider
> program j
>   x = erf(1.5)
> end program j
> With a 4.2 gfortran prior to your patches, -fdump-tree-original gives
> MAIN__ ()
> {
>   real4 x;
>   _gfortran_set_std (70, 127, 0);
>   x = __builtin_erff (1.5e+0);
> }
> With a fairly up to date trunk with your patch, I get
> MAIN__ ()
> {
>   real4 x;
>   _gfortran_set_std (70, 127, 0, 0);
>   x = 9.66105163097381591796875e-1;
> }

Okay, actually I'm pleased to know that fortran uses the generic middle-end
builtins infrastructure.  Anyway, looks like it works for you (and me) so I
agree it's likely darwin specific and I'm still of the opinion it's not a
darwin GCC bug, but rather a buggy build of GMP and/or MPFR on Tobi's darwin
box.  What say you Tobi, can you confirm either way?


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-02-16  5:16 ` ghazi at gcc dot gnu dot org
@ 2007-02-16 13:32 ` tobi at gcc dot gnu dot org
  2007-02-16 13:34 ` tobi at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-16 13:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tobi at gcc dot gnu dot org  2007-02-16 13:31 -------
The backtrace ends in mpfr_erf, I couldn't go further up.  To overcome this
difficulty, I set a breakpoint on the caller, see below.

For the record as there seems to have been some confusion: this bug doesn't
appear during gfortran's constant folding, but during later compilation stages
(as evidenced by its dependence on -O, also I don't think we fold erf at all in
the Fortran FE).

If I find out how I can have my own mpfr and gmp coexist with the fink
libraries, I'll try setting up my own.  In the past, attempts I made at doing
this (on Linux) have failed.  Looking through the fink scripts, it seems that
its mpfr is a build with no unusual configure arguments, gmp is patched to
disable the assembly fragments but nothing unusual except for that.

----

Here's what it looks like on entry to do_mpfr_arg1 with Steve's testcase:
(gdb) run -O erf.f
Starting program: /Users/tobi/src/pristine/build/gcc/f951 -O erf.f
 MAIN__
Breakpoint 1, do_mpfr_arg1 (arg=0x42692b60, type=0x426f4a80, func=0x3179ab
<finalize_type_size+11>, min=0x1adcee, max=0x42692000, inclusive=66 'B') at
../../gcc/builtins.c:11923
11923   {
(gdb) p debug_tree (arg)
 <real_type 0x42692b60 real4 SF
    size <integer_cst 0x42685720 type <integer_type 0x42692070 bit_size_type>
constant invariant 32>
    unit size <integer_cst 0x426854c0 type <integer_type 0x42692000> constant
invariant 4>
    align 32 symtab 0 alias set -1 canonical type 0x42692b60 precision 32
    pointer_to_this <pointer_type 0x42692cb0>>
$9 = void
(gdb) bt
#0  do_mpfr_arg1 (arg=0x42692b60, type=0x426f4a80, func=0x3179ab
<finalize_type_size+11>, min=0x1adcee, max=0x42692000, inclusive=66 'B') at
../../gcc/builtins.c:11923
#1  0x000e3e8d in fold_builtin_1 (fndecl=0x426df300, arg0=0x20, ignore=0 '\0')
at ../../gcc/builtins.c:9301
Previous frame inner to this frame (corrupt stack?)
(gdb)

(understanding the stack seems to be a hard problem on Darwin, gdb fails quite
often making it fairly annoying to step through the code)


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-02-16 13:32 ` tobi at gcc dot gnu dot org
@ 2007-02-16 13:34 ` tobi at gcc dot gnu dot org
  2007-02-16 19:13 ` ghazi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-16 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tobi at gcc dot gnu dot org  2007-02-16 13:33 -------
Oh, just noticed this by chance: Steve's testcase also fails with optimization
disabled, again the call to mpfr_erf is issued in do_mpfr_arg1.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-02-16 13:34 ` tobi at gcc dot gnu dot org
@ 2007-02-16 19:13 ` ghazi at gcc dot gnu dot org
  2007-02-16 19:23 ` ghazi at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-16 19:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ghazi at gcc dot gnu dot org  2007-02-16 19:13 -------
(In reply to comment #8)
> Oh, just noticed this by chance: Steve's testcase also fails with optimization
> disabled, again the call to mpfr_erf is issued in do_mpfr_arg1.

Do you get a failure with a C testcase equivalent to Steve's fortran one?

Does the GCC testcase gcc.dg/torture/builtin-math-3.c pass for you?  That one
tests for erf(1.0) and erf(-1.0).  I'm curious if it's the value 1.5 or whether
having it come from the fortran frontend (or either/both) which is the bug
trigger.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-02-16 19:13 ` ghazi at gcc dot gnu dot org
@ 2007-02-16 19:23 ` ghazi at gcc dot gnu dot org
  2007-02-17 15:10 ` tobi at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-16 19:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ghazi at gcc dot gnu dot org  2007-02-16 19:23 -------
(In reply to comment #7)
> The backtrace ends in mpfr_erf, I couldn't go further up.  To overcome this
> difficulty, I set a breakpoint on the caller, see below.

That's perhaps because mpfr_erf is called from do_mpfr_arg1 via a function
pointer rather than directly, which confuses gdb (I'm guessing).



> the Fortran FE).
> If I find out how I can have my own mpfr and gmp coexist with the fink
> libraries, I'll try setting up my own.  In the past, attempts I made at doing
> this (on Linux) have failed.  Looking through the fink scripts, it seems that
> its mpfr is a build with no unusual configure arguments, gmp is patched to
> disable the assembly fragments but nothing unusual except for that.

To have your own gmp/mpfr co-exist, simply build them yourself and install them
in some private directory.  Configure then as none-apple-darwin I think.  Make
sure you run "make check" for both libraries before installing them and make
sure everything passes.  Then when configuring gcc, pass the configure flag
--with-gmp=PATH --with-mpfr=PATH.  Run the top level configure --help for more
docs on those flags.  Note if gmp and mpfr are installed in the same prefix,
then you only need one of the two flags, but having both should not hurt.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-02-16 19:23 ` ghazi at gcc dot gnu dot org
@ 2007-02-17 15:10 ` tobi at gcc dot gnu dot org
  2007-02-17 16:15 ` ghazi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-17 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from tobi at gcc dot gnu dot org  2007-02-17 15:10 -------
(In reply to comment #9)
> (In reply to comment #8)
> > Oh, just noticed this by chance: Steve's testcase also fails with optimization
> > disabled, again the call to mpfr_erf is issued in do_mpfr_arg1.
> 
> Do you get a failure with a C testcase equivalent to Steve's fortran one?
> 
> Does the GCC testcase gcc.dg/torture/builtin-math-3.c pass for you?  That one
> tests for erf(1.0) and erf(-1.0).  I'm curious if it's the value 1.5 or whether
> having it come from the fortran frontend (or either/both) which is the bug
> trigger.

I couldn't try with the testsuite due to an unrelated bug with fixincludes
(??), but the equivalent C testcase does indeed fail with the same error, as it
should.

I understand the idea of bulding with --prefix, it's just that I've had mixed
success using it wiht mpfr/gmp.  Especially, when the system administrator
installed them locally behind my back.  I'll give it a try, hopefully later
today.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-02-17 15:10 ` tobi at gcc dot gnu dot org
@ 2007-02-17 16:15 ` ghazi at gcc dot gnu dot org
  2007-02-17 17:12 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-17 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from ghazi at gcc dot gnu dot org  2007-02-17 16:15 -------
(In reply to comment #11)
> I understand the idea of bulding with --prefix, it's just that I've had mixed
> success using it wiht mpfr/gmp.  Especially, when the system administrator
> installed them locally behind my back.  I'll give it a try, hopefully later
> today.

Ok, try also configuring your private gmp/mpfr with --disable-shared to avoid
these problems.  Then you won't have to worry about LD_LIBRARY_PATH or other
headaches with shared libs.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2007-02-17 16:15 ` ghazi at gcc dot gnu dot org
@ 2007-02-17 17:12 ` tobi at gcc dot gnu dot org
  2007-02-17 17:14 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-17 17:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from tobi at gcc dot gnu dot org  2007-02-17 17:12 -------
Midair collision, I had just written this, but I do indeed have problems with
shared libraries taking precedence over others, so it looks like I'll have to
rebuild gcc once more:

OK, I tried the following:
1. I built and ran the following testcase with both a homegrown gmp/mpfr combo
and the one provided by fink, with no problems
    #include <stdio.h>
    #include <mpfr.h>

    int main (int argc, char **argv)
    {
      mpfr_t x;

      mpfr_init (x);
      mpfr_set_ui (x, 1, GMP_RNDN);
      mpfr_erf (x, x, GMP_RNDN);
      mpfr_out_str (stdout, 10, 0, x, GMP_RNDN);
    }

2. I rebuilt gcc with my home-built gmp and mpfr, and I'm still seeing the same
error as before

BTW the correct configure option for gmp is --build=none-apple-darwin, not
--host.  You may want to put this in the documentation someplace.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2007-02-17 17:12 ` tobi at gcc dot gnu dot org
@ 2007-02-17 17:14 ` tobi at gcc dot gnu dot org
  2007-02-17 17:46 ` tobi at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-17 17:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from tobi at gcc dot gnu dot org  2007-02-17 17:14 -------
(In reply to comment #13)
> Midair collision, I had just written this, but I do indeed have problems with
> shared libraries taking precedence over others, so it looks like I'll have to
> rebuild gcc once more:

That is to say that I had always linked against the system gmp, mpfr links
statically, so I can't verify which one is chosen.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2007-02-17 17:14 ` tobi at gcc dot gnu dot org
@ 2007-02-17 17:46 ` tobi at gcc dot gnu dot org
  2007-02-17 18:37 ` ghazi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-02-17 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from tobi at gcc dot gnu dot org  2007-02-17 17:46 -------
I moved my system gmp & mpfr out of the way, re-built gmp and mpfr with
--disable-shared, and I'm now getting a bootstrap failure 
/usr/bin/ld: Undefined symbols:
___gmpn_preinv_divrem_1
collect2: ld returned 1 exit status
make[3]: *** [cc1-dummy] Error 1
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

I'm not going to look into this further today.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2007-02-17 17:46 ` tobi at gcc dot gnu dot org
@ 2007-02-17 18:37 ` ghazi at gcc dot gnu dot org
  2007-02-17 19:10 ` ghazi at gcc dot gnu dot org
  2007-03-11 18:53 ` tobi at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-17 18:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from ghazi at gcc dot gnu dot org  2007-02-17 18:36 -------
(In reply to comment #14)
> (In reply to comment #13)
> > Midair collision, I had just written this, but I do indeed have problems with
> > shared libraries taking precedence over others, so it looks like I'll have to
> > rebuild gcc once more:
> That is to say that I had always linked against the system gmp, mpfr links
> statically, so I can't verify which one is chosen.

Maybe we should have "gcc -v" print out the gmp and mpfr versions to help debug
situations like this.


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2007-02-17 18:37 ` ghazi at gcc dot gnu dot org
@ 2007-02-17 19:10 ` ghazi at gcc dot gnu dot org
  2007-03-11 18:53 ` tobi at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: ghazi at gcc dot gnu dot org @ 2007-02-17 19:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from ghazi at gcc dot gnu dot org  2007-02-17 19:10 -------
(In reply to comment #16)
> Maybe we should have "gcc -v" print out the gmp and mpfr versions to help debug
> situations like this.

Patch for "gcc -v" here:
http://gcc.gnu.org/ml/gcc-patches/2007-02/msg01503.html


-- 


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


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

* [Bug middle-end/30816] gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization
  2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2007-02-17 19:10 ` ghazi at gcc dot gnu dot org
@ 2007-03-11 18:53 ` tobi at gcc dot gnu dot org
  17 siblings, 0 replies; 19+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-11 18:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from tobi at gcc dot gnu dot org  2007-03-11 18:53 -------
The tests no longer fail, even with the system gmp/mpfr (which haven't been
updated), so I'm closing this as WORKSFORME.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WORKSFORME


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


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

end of thread, other threads:[~2007-03-11 18:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16  1:21 [Bug middle-end/30816] New: gfortran.dg/g77/intrinsic-unix-erf.f tests fail with optimization tobi at gcc dot gnu dot org
2007-02-16  1:25 ` [Bug middle-end/30816] " tobi at gcc dot gnu dot org
2007-02-16  1:30 ` tobi at gcc dot gnu dot org
2007-02-16  3:44 ` ghazi at gcc dot gnu dot org
2007-02-16  3:53 ` kargl at gcc dot gnu dot org
2007-02-16  5:08 ` ghazi at gcc dot gnu dot org
2007-02-16  5:16 ` ghazi at gcc dot gnu dot org
2007-02-16 13:32 ` tobi at gcc dot gnu dot org
2007-02-16 13:34 ` tobi at gcc dot gnu dot org
2007-02-16 19:13 ` ghazi at gcc dot gnu dot org
2007-02-16 19:23 ` ghazi at gcc dot gnu dot org
2007-02-17 15:10 ` tobi at gcc dot gnu dot org
2007-02-17 16:15 ` ghazi at gcc dot gnu dot org
2007-02-17 17:12 ` tobi at gcc dot gnu dot org
2007-02-17 17:14 ` tobi at gcc dot gnu dot org
2007-02-17 17:46 ` tobi at gcc dot gnu dot org
2007-02-17 18:37 ` ghazi at gcc dot gnu dot org
2007-02-17 19:10 ` ghazi at gcc dot gnu dot org
2007-03-11 18:53 ` tobi 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).