public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: charfi asma <charfiasma@yahoo.fr>
To: Andi Hellmund <mail@andihellmund.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re : [gcc front end] add options
Date: Thu, 03 Feb 2011 18:24:00 -0000	[thread overview]
Message-ID: <710437.94578.qm@web28515.mail.ukl.yahoo.com> (raw)
In-Reply-To: <4D48375E.1020104@andihellmund.com>





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



      parent reply	other threads:[~2011-02-03 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 15:43 charfi asma
2011-02-01 16:40 ` Andi Hellmund
2011-02-01 18:07   ` Philip Herron
2011-02-03 18:24   ` charfi asma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=710437.94578.qm@web28515.mail.ukl.yahoo.com \
    --to=charfiasma@yahoo.fr \
    --cc=gcc-help@gcc.gnu.org \
    --cc=mail@andihellmund.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).