Bug 39674 - Error building with SUN cc (forte 6.2) compiler
Summary: Error building with SUN cc (forte 6.2) compiler
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-07 13:02 UTC by Philippe Poilbarbe
Modified: 2009-04-28 23:11 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Modofed source files in order to compile on Sun/Solaris 2.8 with forte 6.2 C compiler (558 bytes, patch)
2009-04-07 13:03 UTC, Philippe Poilbarbe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Poilbarbe 2009-04-07 13:02:02 UTC
When trying to build on Sparc/Sun-Solaris 2.8 with cc command from SUN Forte 6.2, we have compilation error because of assignation between const and non const variables.
I have patched the source code with problem (2 files) in order to compile it.
The patch file is joined with this bug report to allow you to analyze it.
Comment 1 Philippe Poilbarbe 2009-04-07 13:03:19 UTC
Created attachment 17599 [details]
Modofed source files in order to compile on Sun/Solaris 2.8 with forte 6.2 C compiler
Comment 2 Paolo Carlini 2009-04-07 13:13:58 UTC
This Bugzilla is for *GCC*, which has nothing to do with the Sun compiler.
Comment 3 Richard Biener 2009-04-07 13:20:15 UTC
But the patch is against gcc and we support building with other host compilers.
Comment 4 Paolo Carlini 2009-04-07 13:22:33 UTC
Ah, by *compile* they mean *building* GCC iself ;) Ok, then this PR should be tweaked quite a bit (C++?)
Comment 5 Philippe Poilbarbe 2009-04-07 13:25:33 UTC
Yes, but building GCC (as said) with Sun compiler (or other) has to do with GCC.

(In reply to comment #2)
> This Bugzilla is for *GCC*, which has nothing to do with the Sun compiler.
> 

Comment 6 Paolo Carlini 2009-04-07 13:28:28 UTC
Yes, but please fix your report: the issue has nothing to do with c++, I guess. Also Host / Target / Build should likely be just sparc-sun-solaris2.8, no?
Comment 7 Philippe Poilbarbe 2009-04-07 13:35:58 UTC
(In reply to comment #6)
> Yes, but please fix your report: the issue has nothing to do with c++, I guess.
> Also Host / Target / Build should likely be just sparc-sun-solaris2.8, no?
> 

I don't know if it is C++, I am not very aware of this; the files involved are: gcc/fixed-value.c and gcc/tree-ssa-loop-ivopts.c
I saw compilation errors on this files and tried to fix it: it was only assignment errors (there is many other warnings about assignment error). I only said that it is gcc (built for c, c++ and fortran languages only) and I don't know which part of the gcc suite they belong to.
Comment 8 Andrew Pinski 2009-04-28 23:11:31 UTC
  /* This was a conditional expression but it triggered a bug in
     Sun C 5.5.  */
  if (subtract_p)
    temp = double_int_neg (b->data);
  else
    temp = b->data;

  /* This was a conditional expression but it triggered a bug in
     Sun C 5.5.  */
  if (ivs->bad_uses) 
    return infinite_cost;
  else
    return ivs->cost;


Fixed by:
2008-12-08  Andrew Haley  <aph@redhat.com>
            Kamaraju Kusumanchi  <raju.mailinglists@gmail.com>
        
        * gimple.h (gimple_build_try): Fix declaration.

        * builtins.c (fold_builtin_sqrt): Don't use a conditional operator.
        * fixed-value.c (do_fixed_add): Likewise.
        * tree-ssa-loop-ivopts.c (iv_ca_cost): Likewise.