c/2787: Compiler dump core on sparc-sun-solaris2.7

Haj.Ten.Brugge@net.HCC.nl Haj.Ten.Brugge@net.HCC.nl
Wed May 9 01:36:00 GMT 2001


>Number:         2787
>Category:       c
>Synopsis:       Compiler dump core on sparc-sun-solaris2.7
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 09 01:36:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Haj.Ten.Brugge@net.HCC.nl
>Release:        3.0 and 3.1
>Organization:
>Environment:
sparc-sun-solaris2.7
>Description:
The compiler dumps core with the following testcase:

long double
bug(long double src)
{
  if (src > -0.1 && src < 0.1)
    {
      int i;
      long double r = 1.0;
      long double k = 1.0;
      long double s = 0.0;

      for (i = 1 ; i < 10 ; i++)
        {
          r *= src;
          k *= (long double)i;
          s += r / k;
        }
      src = s;
    }
  return src;
}

int
main()
{
  if (bug(0.05) < 0.051)
    abort();
  exit(0);
}

when compiled with '-O2 -g' on sparc-sun-solaris2.7. The reported
error is:
In function `bug':
20: Internal compiler error in schedule_insns, at sched-rgn.c:3070
Please submit a full bug report, with preprocessed source if appropriate.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

The code compiles when only using -O2 but then the result
is incorrect.

Perhaps this testcase should be added to the gcc.c-torture/execute.

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list