This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
G77: patch to bitwise .AND. errors
- From: Hassan Aurag <aurag at cae dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: 07 May 2002 15:27:06 -0400
- Subject: G77: patch to bitwise .AND. errors
Hi all concerned,
Looking at the sources of 2.95.1 of gcc, I have noticed that with
-fugly-logint option all operations involving logicals would first cast
logical to int except for logical operations.
Now adding the casting section to the function that is called for
logical operations fixes the issue I had before: bug #`fortran/6491'.
Here is a patch. Now I'd love if someone knowledgeable took a look at
it to check if it's crappy, dangerous, erroneous, stupid or what. My
knowledge of compilators being non-existent, and of coding in general
very limited.
Thanks
diff -cr gcc-2.95.1/gcc/f/expr.c gcc-2.95.1_hassan/gcc/f/expr.c
*** gcc-2.95.1/gcc/f/expr.c Sat May 15 11:46:08 1999
--- gcc-2.95.1_hassan/gcc/f/expr.c Tue May 7 14:51:56 2002
***************
*** 11495,11501 ****
--- 11495,11520 ----
}
/* else Leave it alone. */
}
+ /* Hassan's Temporary Addition to Fix logical and/or... */
+ if (lbt == FFEINFO_basictypeLOGICAL)
+ {
+ ffebld_set_left (reduced, ffeexpr_convert (ffebld_left (reduced),
+ l->token, op->token, FFEINFO_basictypeINTEGER,
+ FFEINFO_kindtypeINTEGERDEFAULT, 0,
+ FFETARGET_charactersizeNONE,
+ FFEEXPR_contextLET));
+ }
+ if (rbt == FFEINFO_basictypeLOGICAL)
+ {
+ ffebld_set_right (reduced, ffeexpr_convert (ffebld_right (reduced),
+ r->token, op->token, FFEINFO_basictypeINTEGER,
+ FFEINFO_kindtypeINTEGERDEFAULT, 0,
+ FFETARGET_charactersizeNONE,
+ FFEEXPR_contextLET));
+ }
+
+ /* End Of Hassan's Temporary Addition */
return reduced;
}