Decho, be reassured that taking ibuprofen is most likely not going to cause problems with your stomach or intestines.
The history is that ibuprofen was originally developed by the Boots company, who in those days were a proper pharmaceutical company not just a high street chemist. It was a point when paracetamol was being marketed as causing fewer side effects than aspirin, and Boots got their research chemists to look for a compound that worked in the same way as aspirin but without the effects on the stomach. When they came up with ibuprofen they applied for a licence to sell it with a maximum dose such that there were fewer side effects even than for paracetamol.
So unless you are personally sensitive for some reason, taking 3 x 400 mg ibuprofen should be fine. In fact ibuprofen isn't seriously toxic even if you take quite a lot more (though inevitably side effects will then be greater) and there are conditions for which doctors prescribe twice as much, admittedly under supervision. And apparently it is unnecessary to take it with food. In contrast taking double the recommended dose of paracetamol is likely to lead to liver toxicity problems.
However most doctors are unaware of this background, and apply the same cautions to ibuprofen use as they would to aspirin or other members of the same drug class which have far greater effects on the stomach.
As you have discovered, many people find ibuprofen particularly effective on musculoskeletal aches and pains. Obviously you want to get your specific problems checked out, but there is a good chance that if your hip pain responds so well to ibuprofen it is likely to be the sort of musculoskeletal problem all of us are liable to as we get older, and quite separate from your prostate cancer.