This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]