public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* [gcc front end] add options
@ 2011-02-01 15:43 charfi asma
  2011-02-01 16:40 ` Andi Hellmund
  0 siblings, 1 reply; 4+ messages in thread
From: charfi asma @ 2011-02-01 15:43 UTC (permalink / raw)
  To: gcc-help

Hello,

I built a new gcc front end
I would like to use the -fopenmp options when compiling my source file
I could use the C front end options like -S -fdump-tree-all -O*, .... but when I 
use -fopenmp I get this error:

uml1: warning: command line option ‘-fopenmp’ is valid for 
C/C++/Fortran/ObjC/ObjC++ but not for  [enabled by default]

should I modify my lang-specs.h ? If yes what kind of modification ?

here is its content:

{".uml", "@uml", 0, 1, 0},
{"@uml", "uml1 %i %(invoke_as)", 0, 1, 0},
{"@uml",  "uml1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}",
    0, 1, 0},


thank you very much

Asma




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

* Re: [gcc front end] add options
  2011-02-01 15:43 [gcc front end] add options charfi asma
@ 2011-02-01 16:40 ` Andi Hellmund
  2011-02-01 18:07   ` Philip Herron
  2011-02-03 18:24   ` Re : " charfi asma
  0 siblings, 2 replies; 4+ messages in thread
From: Andi Hellmund @ 2011-02-01 16:40 UTC (permalink / raw)
  To: charfi asma; +Cc: gcc-help

On 2/1/2011 4:43 PM, charfi asma wrote:
> Hello,
>
> I built a new gcc front end
> I would like to use the -fopenmp options when compiling my source file
> I could use the C front end options like -S -fdump-tree-all -O*, .... but when I
> use -fopenmp I get this error:
>
> uml1: warning: command line option ‘-fopenmp’ is valid for
> C/C++/Fortran/ObjC/ObjC++ but not for  [enabled by default]
>
> should I modify my lang-specs.h ? If yes what kind of modification ?
>
> here is its content:
>
> {".uml", "@uml", 0, 1, 0},
> {"@uml", "uml1 %i %(invoke_as)", 0, 1, 0},
> {"@uml",  "uml1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}",
>      0, 1, 0},
>
>
> thank you very much
>
> Asma
>    
Hey Asma,

I think adding -fopenmp to lang-specs.h wouldn't help since the error 
message comes from uml1 (compiler proper). And by the way, the -f* 
options are usually already included in %{cc1_options}. The original 
definition of the -fopenmp option is available in c.opt (in c-family 
directory of 4.6), but please have a look at the lang.opt file of the 
Fortran front-end for details. This is how this is implemented there:

fopenmp
Fortran
; Documented in C

This then allows the Fortran front-end to "reuse" the definition of the 
C (family) front-ends.

Best regards,
Andre-Marcel

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

* Re: [gcc front end] add options
  2011-02-01 16:40 ` Andi Hellmund
@ 2011-02-01 18:07   ` Philip Herron
  2011-02-03 18:24   ` Re : " charfi asma
  1 sibling, 0 replies; 4+ messages in thread
From: Philip Herron @ 2011-02-01 18:07 UTC (permalink / raw)
  To: Andi Hellmund; +Cc: charfi asma, gcc-help

I may be wrong but i think you also need to tell your front-end how to
or what to do with the open mp stuff since there are langhooks for
openmp bits and bobs if i am not mistaken but i haven't much
experience there to really know.

--Phil

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

* Re : [gcc front end] add options
  2011-02-01 16:40 ` Andi Hellmund
  2011-02-01 18:07   ` Philip Herron
@ 2011-02-03 18:24   ` charfi asma
  1 sibling, 0 replies; 4+ messages in thread
From: charfi asma @ 2011-02-03 18:24 UTC (permalink / raw)
  To: Andi Hellmund; +Cc: gcc-help





----- Message d'origine ----
De : Andi Hellmund <mail@andihellmund.com>
À : charfi asma <charfiasma@yahoo.fr>
Cc : gcc-help@gcc.gnu.org
Envoyé le : Mar 1 février 2011, 17h 39min 58s
Objet : Re: [gcc front end] add options

On 2/1/2011 4:43 PM, charfi asma wrote:
> Hello,
>
> I built a new gcc front end
> I would like to use the -fopenmp options when compiling my source file
> I could use the C front end options like -S -fdump-tree-all -O*, .... but when 
>I
> use -fopenmp I get this error:
>
> uml1: warning: command line option ‘-fopenmp’ is valid for
> C/C++/Fortran/ObjC/ObjC++ but not for  [enabled by default]
>
> should I modify my lang-specs.h ? If yes what kind of modification ?
>
> here is its content:
>
> {".uml", "@uml", 0, 1, 0},
> {"@uml", "uml1 %i %(invoke_as)", 0, 1, 0},
> {"@uml",  "uml1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}",
>      0, 1, 0},
>
>
> thank you very much
>
> Asma
>    
Hey Asma,

I think adding -fopenmp to lang-specs.h wouldn't help since the error 
message comes from uml1 (compiler proper). And by the way, the -f* 
options are usually already included in %{cc1_options}. The original 
definition of the -fopenmp option is available in c.opt (in c-family 
directory of 4.6), but please have a look at the lang.opt file of the 
Fortran front-end for details. This is how this is implemented there:

fopenmp
Fortran
; Documented in C

This then allows the Fortran front-end to "reuse" the definition of the 
C (family) front-ends.

Best regards,
Andre-Marcel


Hello,

thank you Philip and Andi for your help.

I added the fopenmp options to my lang.opt file as fortran fe does, but I always 
get the same warning expect that my fe language name is added to the list of fe 
that enable the use of fopenmp

uml1: warning: command line option ‘-fopenmp’ is valid for 
C/C++/Fortran/ObjC/ObjC++/uml but not for  [enabled by default]


yes the error in my front end comes from the uml1.c because I tried to build the 
Generic form correspending to #pragma omp parallel
I get the gimplified expression as provided by c++ front end
here is my gimple 

main ()
gimple_bind <
  <unnamed-signed:32> D.28;
  struct MyClass x;

  gimple_omp_parallel <
    BODY <
      gimple_bind <
        gimple_call <MyOperation1, NULL, &x>
        gimple_call <MyOperation2, NULL, &x>
      >
    >
    CLAUSES < shared(x) >, NULL, NULL
  >
  gimple_assign <integer_cst, D.28, 0, NULL>
  gimple_return <D.28>
>


MyOperation2 (struct MyClass * this)
gimple_bind <
  gimple_assign <integer_cst, this->MyAttribute2, 15, NULL>
  gimple_return <NULL>
>


MyOperation1 (struct MyClass * this)
gimple_bind <
  gimple_assign <integer_cst, this->MyAttribute1, 10, NULL>
  gimple_return <NULL>
>



but it does not contain the built-in function (as gimple generated from c++ fe)

<built-in> (struct .omp_data_s.0 * .omp_data_i)
{
  struct MyClass c [value-expr: *.omp_data_i->c];
  struct MyClass * D.1788;
  struct MyClass * D.1787;
  struct MyClass * D.1786;
  struct MyClass * D.1785;

<bb 5>:

<bb 3>:
  gimple_assign <component_ref, D.1785, .omp_data_i->c, NULL>
....
}

one of the reason is that my flag_openmp is always null, even if I specify 
-fopenmp while compiling.
i,e: when my front end calls the execute_lower_omp(void) it does nothing
execute_lower_omp (void)
{
  gimple_seq body;

  /* This pass always runs, to provide PROP_gimple_lomp.
     But there is nothing to do unless -fopenmp is given.  */
  if (flag_openmp == 0)
    return 0;
....
}

any idea to change fe flag_openmp value ?  

thank you very much.

Asma



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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 15:43 [gcc front end] add options charfi asma
2011-02-01 16:40 ` Andi Hellmund
2011-02-01 18:07   ` Philip Herron
2011-02-03 18:24   ` Re : " charfi asma

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).