This is the mail archive of the gcc-patches@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]

Re: [PATCH] fortran/50514 -- Fix static chekcing of ISHFT[C] arguments.


On 10/17/2011 07:02 PM, Steve Kargl wrote:
On Mon, Oct 17, 2011 at 12:22:03PM +0200, Tobias Burnus wrote:
I am not so happy with complete test replacements. How about adding it
as new test case?
Well, the old testcase is
[...]

The only line that would survive is the first line, which
is covered in the updated testcase.

Convinced: Do the replacement.


I somehow find less_than_bitsize1's

+ if (strncmp (arg2, "ISHFT", 5) == 0)

not that elegant and would prefer another argument, which tells the
function that it should take the absolute value of the argument;
however, given that ISHFT seems to be the only function which allows
negative arguments, one could also leave it.
In looking at the other uses of less_than_bitsize1() I
could pass arg2=NULL for ISHFT[C], and then the code
would become

if (arg2 == NULL) { /* Special case for ISHFT[C]. */

Would that be better?

It would be faster - but not necessarily better. I was rather thinking of adding another argument like "bool abs_ok".


However, I think all three solutions are OK. Pick one.

Tobias


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